diff --git a/composer.json b/composer.json index 80c362f3..8ee26503 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,6 @@ "ext-filter": "*", "symfony/console": "^6.0", "yiisoft/aliases": "^1.1|^2.0|^3.0", - "yiisoft/arrays": "^2.0|^3.0", "yiisoft/db": "^1.1", "yiisoft/di": "^1.0", "yiisoft/definitions": "^3.0", diff --git a/src/Migrator.php b/src/Migrator.php index c404cc8a..de87e609 100644 --- a/src/Migrator.php +++ b/src/Migrator.php @@ -5,7 +5,6 @@ namespace Yiisoft\Db\Migration; use Symfony\Component\Console\Style\SymfonyStyle; -use Yiisoft\Arrays\ArrayHelper; use Yiisoft\Db\Connection\ConnectionInterface; use Yiisoft\Db\Query\Query; use Yiisoft\Db\Migration\Informer\MigrationInformerInterface; @@ -83,18 +82,16 @@ public function getHistory(?int $limit = null): array $this->checkMigrationHistoryTable(); $query = (new Query($this->db)) - ->select(['name', 'apply_time']) + ->select(['apply_time', 'name']) ->from($this->historyTable) - ->orderBy(['apply_time' => SORT_DESC, 'id' => SORT_DESC]); + ->orderBy(['apply_time' => SORT_DESC, 'id' => SORT_DESC]) + ->indexBy('name'); if ($limit > 0) { $query->limit($limit); } - /** @psalm-var array> $rows */ - $rows = $query->all(); - - return ArrayHelper::map($rows, 'name', 'apply_time'); + return $query->column(); } public function getHistoryTable(): string