mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-11-29 20:29:48 +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/
|
/infection/
|
||||||
a.php
|
a.php
|
||||||
.phpunit.cache
|
.phpunit.cache
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
[![Psalm level 1](https://shepherd.dev/github/danog/AsyncOrm/level.svg)](https://shepherd.dev/github/danog/AsyncOrm)
|
[![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)
|
![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.
|
Supports MySQL, Redis, Postgres.
|
||||||
|
|
||||||
|
@ -168,8 +168,10 @@ final class MysqlArray extends SqlArray
|
|||||||
} elseif ($key === 'value') {
|
} elseif ($key === 'value') {
|
||||||
$expected = $valueType;
|
$expected = $valueType;
|
||||||
} else {
|
} else {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
$db->query("ALTER TABLE `{$config->table}` DROP `$key`");
|
$db->query("ALTER TABLE `{$config->table}` DROP `$key`");
|
||||||
continue;
|
continue;
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
if ($expected !== $type || $null !== 'NO') {
|
if ($expected !== $type || $null !== 'NO') {
|
||||||
$db->query("ALTER TABLE `{$config->table}` MODIFY `$key` $expected NOT NULL");
|
$db->query("ALTER TABLE `{$config->table}` MODIFY `$key` $expected NOT NULL");
|
||||||
@ -182,11 +184,15 @@ final class MysqlArray extends SqlArray
|
|||||||
->execute([$database, $config->table])
|
->execute([$database, $config->table])
|
||||||
->fetchRow();
|
->fetchRow();
|
||||||
if ($result === null) {
|
if ($result === null) {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
throw new AssertionError("Result cannot be null!");
|
throw new AssertionError("Result cannot be null!");
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
$result = $result['data_free'] ?? $result['DATA_FREE'];
|
$result = $result['data_free'] ?? $result['DATA_FREE'];
|
||||||
if (!\is_int($result)) {
|
if (!\is_int($result)) {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
throw new AssertionError("data_free must be an integer!");
|
throw new AssertionError("data_free must be an integer!");
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
if (($result >> 20) >= $settings->optimizeIfWastedMb) {
|
if (($result >> 20) >= $settings->optimizeIfWastedMb) {
|
||||||
$db->query("OPTIMIZE TABLE `{$config->table}`");
|
$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");
|
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" TYPE $expected");
|
||||||
}
|
}
|
||||||
if ($null !== 'NO') {
|
if ($null !== 'NO') {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" SET NOT NULL");
|
$connection->query("ALTER TABLE \"bytea_{$config->table}\" ALTER COLUMN \"$key\" SET NOT NULL");
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user