diff --git a/src/Schema.php b/src/Schema.php index 23d46723..466c8989 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -21,6 +21,7 @@ use Yiisoft\Db\Schema\TableSchemaInterface; use function array_column; +use function array_map; use function array_merge; use function count; use function explode; @@ -201,7 +202,7 @@ protected function loadTableForeignKeys(string $tableName): array $foreignKeysList = $this->getPragmaForeignKeyList($tableName); /** @psalm-var ForeignKeyInfo[] $foreignKeysList */ - $foreignKeysList = $this->normalizeRowKeyCase($foreignKeysList, true); + $foreignKeysList = array_map('array_change_key_case', $foreignKeysList); $foreignKeysList = DbArrayHelper::index($foreignKeysList, null, ['table']); DbArrayHelper::multisort($foreignKeysList, 'seq'); @@ -553,7 +554,7 @@ private function loadTableColumnsInfo(string $tableName): array { $tableColumns = $this->getPragmaTableInfo($tableName); /** @psalm-var ColumnInfo[] $tableColumns */ - $tableColumns = $this->normalizeRowKeyCase($tableColumns, true); + $tableColumns = array_map('array_change_key_case', $tableColumns); /** @psalm-var ColumnInfo[] */ return DbArrayHelper::index($tableColumns, 'cid'); @@ -575,7 +576,7 @@ private function loadTableConstraints(string $tableName, string $returnType): Co { $indexList = $this->getPragmaIndexList($tableName); /** @psalm-var IndexListInfo[] $indexes */ - $indexes = $this->normalizeRowKeyCase($indexList, true); + $indexes = array_map('array_change_key_case', $indexList); $result = [ self::PRIMARY_KEY => null, self::INDEXES => [], @@ -662,7 +663,7 @@ private function getPragmaIndexInfo(string $name): array $column = $this->db ->createCommand('PRAGMA INDEX_INFO(' . (string) $this->db->getQuoter()->quoteValue($name) . ')') ->queryAll(); - $column = $this->normalizeRowKeyCase($column, true); + $column = array_map('array_change_key_case', $column); DbArrayHelper::multisort($column, 'seqno'); /** @psalm-var IndexInfo[] $column */ @@ -726,7 +727,7 @@ protected function findViewNames(string $schema = ''): array */ protected function getCacheKey(string $name): array { - return array_merge([self::class], $this->generateCacheKey(), [$this->getRawTableName($name)]); + return array_merge([self::class], $this->generateCacheKey(), [$this->db->getQuoter()->getRawTableName($name)]); } /**