Skip to content

Commit 1ff8e29

Browse files
committed
Cleanup README.md, legacy MadelineProto table migration coverage
1 parent 3180939 commit 1ff8e29

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode
12
/infection/
23
a.php
34
.phpunit.cache

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Psalm level 1](https://shepherd.dev/github/danog/AsyncOrm/level.svg)](https://shepherd.dev/github/danog/AsyncOrm)
66
![License](https://img.shields.io/github/license/danog/AsyncOrm)
77

8-
Async ORM based on AMPHP v3 and fibers, created by Daniil Gentili <daniil@daniil.it> and Alexander Pankratov <alexander@i-c-a.su>.
8+
Async ORM based on AMPHP v3 and fibers, created by Daniil Gentili (https://daniil.it) and Alexander Pankratov (alexander@i-c-a.su).
99

1010
Supports MySQL, Redis, Postgres.
1111

src/Internal/Driver/MysqlArray.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ public function __construct(DbArrayBuilder $config, Serializer $serializer)
168168
} elseif ($key === 'value') {
169169
$expected = $valueType;
170170
} else {
171+
// @codeCoverageIgnoreStart
171172
$db->query("ALTER TABLE `{$config->table}` DROP `$key`");
172173
continue;
174+
// @codeCoverageIgnoreEnd
173175
}
174176
if ($expected !== $type || $null !== 'NO') {
175177
$db->query("ALTER TABLE `{$config->table}` MODIFY `$key` $expected NOT NULL");
@@ -182,11 +184,15 @@ public function __construct(DbArrayBuilder $config, Serializer $serializer)
182184
->execute([$database, $config->table])
183185
->fetchRow();
184186
if ($result === null) {
187+
// @codeCoverageIgnoreStart
185188
throw new AssertionError("Result cannot be null!");
189+
// @codeCoverageIgnoreEnd
186190
}
187191
$result = $result['data_free'] ?? $result['DATA_FREE'];
188192
if (!\is_int($result)) {
193+
// @codeCoverageIgnoreStart
189194
throw new AssertionError("data_free must be an integer!");
195+
// @codeCoverageIgnoreEnd
190196
}
191197
if (($result >> 20) >= $settings->optimizeIfWastedMb) {
192198
$db->query("OPTIMIZE TABLE `{$config->table}`");

src/Internal/Driver/PostgresArray.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ public function __construct(DbArrayBuilder $config, Serializer $serializer)
142142
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" TYPE $expected");
143143
}
144144
if ($null !== 'NO') {
145+
// @codeCoverageIgnoreStart
145146
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" SET NOT NULL");
147+
// @codeCoverageIgnoreEnd
146148
}
147149
}
148150

0 commit comments

Comments
 (0)