From b959dc50ecb9e6524be07b488ed658418befad45 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 29 Jan 2026 11:45:18 +0100 Subject: [PATCH] Add upgrade warning when using legacy phinxlog tables 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. --- src/Command/StatusCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Command/StatusCommand.php b/src/Command/StatusCommand.php index b8489746..7d344c60 100644 --- a/src/Command/StatusCommand.php +++ b/src/Command/StatusCommand.php @@ -18,6 +18,7 @@ use Cake\Console\ConsoleIo; use Cake\Console\ConsoleOptionParser; use Migrations\Config\ConfigInterface; +use Migrations\Db\Adapter\UnifiedMigrationsTableStorage; use Migrations\Migration\ManagerFactory; /** @@ -153,6 +154,9 @@ public function execute(Arguments $args, ConsoleIo $io): ?int protected function display(array $migrations, ConsoleIo $io, string $tableName): void { $io->out(sprintf('using migration table %s', $tableName)); + if ($tableName !== UnifiedMigrationsTableStorage::TABLE_NAME) { + $io->warning('You are using legacy phinxlog tables. Run `migrations upgrade` to switch to the unified `cake_migrations` table.'); + } $io->out(''); if ($migrations) {