mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-11-26 12:24:59 +01:00
Cleanup README.md, legacy MadelineProto table migration coverage
This commit is contained in:
parent
3180939131
commit
1ff8e29eed
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.vscode
|
||||
/infection/
|
||||
a.php
|
||||
.phpunit.cache
|
||||
|
@ -5,7 +5,7 @@
|
||||
[![Psalm level 1](https://shepherd.dev/github/danog/AsyncOrm/level.svg)](https://shepherd.dev/github/danog/AsyncOrm)
|
||||
![License](https://img.shields.io/github/license/danog/AsyncOrm)
|
||||
|
||||
Async ORM based on AMPHP v3 and fibers, created by Daniil Gentili <daniil@daniil.it> and Alexander Pankratov <alexander@i-c-a.su>.
|
||||
Async ORM based on AMPHP v3 and fibers, created by Daniil Gentili (https://daniil.it) and Alexander Pankratov (alexander@i-c-a.su).
|
||||
|
||||
Supports MySQL, Redis, Postgres.
|
||||
|
||||
|
@ -168,8 +168,10 @@ final class MysqlArray extends SqlArray
|
||||
} elseif ($key === 'value') {
|
||||
$expected = $valueType;
|
||||
} else {
|
||||
// @codeCoverageIgnoreStart
|
||||
$db->query("ALTER TABLE `{$config->table}` DROP `$key`");
|
||||
continue;
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
if ($expected !== $type || $null !== 'NO') {
|
||||
$db->query("ALTER TABLE `{$config->table}` MODIFY `$key` $expected NOT NULL");
|
||||
@ -182,11 +184,15 @@ final class MysqlArray extends SqlArray
|
||||
->execute([$database, $config->table])
|
||||
->fetchRow();
|
||||
if ($result === null) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new AssertionError("Result cannot be null!");
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$result = $result['data_free'] ?? $result['DATA_FREE'];
|
||||
if (!\is_int($result)) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new AssertionError("data_free must be an integer!");
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
if (($result >> 20) >= $settings->optimizeIfWastedMb) {
|
||||
$db->query("OPTIMIZE TABLE `{$config->table}`");
|
||||
|
@ -142,7 +142,9 @@ class PostgresArray extends SqlArray
|
||||
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" TYPE $expected");
|
||||
}
|
||||
if ($null !== 'NO') {
|
||||
// @codeCoverageIgnoreStart
|
||||
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" SET NOT NULL");
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user