From ebf6522da054af6186c31d427f1d12a20097231c Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 13 Jan 2026 03:39:36 +0100 Subject: [PATCH 1/2] Remove phinx backend test from 5.x The phinx backend was removed in 5.x, so the test for MigrationsRollbackCommand is not applicable. This test was incorrectly merged from 4.x where phinx backend still exists. --- tests/TestCase/MigrationsPluginTest.php | 26 ++----------------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/tests/TestCase/MigrationsPluginTest.php b/tests/TestCase/MigrationsPluginTest.php index 4b4bc415..81f5f2cd 100644 --- a/tests/TestCase/MigrationsPluginTest.php +++ b/tests/TestCase/MigrationsPluginTest.php @@ -4,21 +4,17 @@ namespace Migrations\Test\TestCase; use Cake\Console\CommandCollection; -use Cake\Core\Configure; use Cake\TestSuite\TestCase; -use Migrations\Command\MigrationsRollbackCommand; use Migrations\Command\RollbackCommand; use Migrations\MigrationsPlugin; class MigrationsPluginTest extends TestCase { /** - * Test that builtin backend uses RollbackCommand + * Test that console() registers the correct RollbackCommand */ - public function testConsoleBuiltinBackendUsesCorrectRollbackCommand(): void + public function testConsoleUsesCorrectRollbackCommand(): void { - Configure::write('Migrations.backend', 'builtin'); - $plugin = new MigrationsPlugin(); $commands = new CommandCollection(); $commands = $plugin->console($commands); @@ -26,22 +22,4 @@ public function testConsoleBuiltinBackendUsesCorrectRollbackCommand(): void $this->assertTrue($commands->has('migrations rollback')); $this->assertSame(RollbackCommand::class, $commands->get('migrations rollback')); } - - /** - * Test that phinx backend uses MigrationsRollbackCommand - * - * This is the reported bug in https://github.com/cakephp/migrations/issues/990 - */ - public function testConsolePhinxBackendUsesCorrectRollbackCommand(): void - { - Configure::write('Migrations.backend', 'phinx'); - - $plugin = new MigrationsPlugin(); - $commands = new CommandCollection(); - $commands = $plugin->console($commands); - - $this->assertTrue($commands->has('migrations rollback')); - // Bug: RollbackCommand is loaded instead of MigrationsRollbackCommand - $this->assertSame(MigrationsRollbackCommand::class, $commands->get('migrations rollback')); - } } From 5db5a6435581e2980831e7ca53f8c6d44bd6eb98 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 13 Jan 2026 03:46:08 +0100 Subject: [PATCH 2/2] Update PostgreSQL timestamp comparison file for 5.x - Update documentation URL from phinx to migrations/5 - Update timestamp type to timestampfractional for columns with precision/scale --- ...t_snapshot_postgres_timestamp_tz_pgsql.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/comparisons/Migration/test_snapshot_postgres_timestamp_tz_pgsql.php b/tests/comparisons/Migration/test_snapshot_postgres_timestamp_tz_pgsql.php index 12842121..51b0002a 100644 --- a/tests/comparisons/Migration/test_snapshot_postgres_timestamp_tz_pgsql.php +++ b/tests/comparisons/Migration/test_snapshot_postgres_timestamp_tz_pgsql.php @@ -9,7 +9,7 @@ class TestSnapshotPostgresTimestampTzPgsql extends BaseMigration * Up Method. * * More information on this method is available here: - * https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method + * https://book.cakephp.org/migrations/5/en/migrations.html#the-up-method * * @return void */ @@ -47,14 +47,14 @@ public function up(): void 'limit' => null, 'null' => true, ]) - ->addColumn('created', 'timestamp', [ + ->addColumn('created', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, 'precision' => 6, 'scale' => 6, ]) - ->addColumn('modified', 'timestamp', [ + ->addColumn('modified', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, @@ -83,14 +83,14 @@ public function up(): void 'limit' => 100, 'null' => true, ]) - ->addColumn('created', 'timestamp', [ + ->addColumn('created', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, 'precision' => 6, 'scale' => 6, ]) - ->addColumn('modified', 'timestamp', [ + ->addColumn('modified', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, @@ -194,14 +194,14 @@ public function up(): void 'limit' => 10, 'null' => true, ]) - ->addColumn('created', 'timestamp', [ + ->addColumn('created', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, 'precision' => 6, 'scale' => 6, ]) - ->addColumn('modified', 'timestamp', [ + ->addColumn('modified', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, @@ -261,7 +261,7 @@ public function up(): void 'limit' => null, 'null' => true, ]) - ->addColumn('highlighted_time', 'timestamp', [ + ->addColumn('highlighted_time', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, @@ -299,14 +299,14 @@ public function up(): void 'limit' => 256, 'null' => true, ]) - ->addColumn('created', 'timestamp', [ + ->addColumn('created', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, 'precision' => 6, 'scale' => 6, ]) - ->addColumn('updated', 'timestamp', [ + ->addColumn('updated', 'timestampfractional', [ 'default' => null, 'limit' => null, 'null' => true, @@ -359,7 +359,7 @@ public function up(): void * Down Method. * * More information on this method is available here: - * https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method + * https://book.cakephp.org/migrations/5/en/migrations.html#the-down-method * * @return void */