Skip to content

Commit 8836d47

Browse files
authored
Add upgrade warning when using legacy phinxlog tables (#1016)
Show a warning in the status command output when the migration table is a legacy phinxlog table, directing users to run `migrations upgrade` to switch to the unified cake_migrations table.
1 parent 822ec20 commit 8836d47

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Command/StatusCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Cake\Console\ConsoleIo;
1919
use Cake\Console\ConsoleOptionParser;
2020
use Migrations\Config\ConfigInterface;
21+
use Migrations\Db\Adapter\UnifiedMigrationsTableStorage;
2122
use Migrations\Migration\ManagerFactory;
2223

2324
/**
@@ -153,6 +154,9 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
153154
protected function display(array $migrations, ConsoleIo $io, string $tableName): void
154155
{
155156
$io->out(sprintf('using migration table <info>%s</info>', $tableName));
157+
if ($tableName !== UnifiedMigrationsTableStorage::TABLE_NAME) {
158+
$io->warning('You are using legacy phinxlog tables. Run `migrations upgrade` to switch to the unified `cake_migrations` table.');
159+
}
156160
$io->out('');
157161

158162
if ($migrations) {

0 commit comments

Comments
 (0)