@@ -1462,8 +1462,21 @@ public function testChangeIndexWithForeignKeys(): void
1462
1462
self ::assertTrue ($ child ->hasIndex ('idx_2 ' ));
1463
1463
}
1464
1464
1465
+ /** @throws Exception */
1465
1466
public function testSwitchPrimaryKeyOrder (): void
1466
1467
{
1468
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1469
+
1470
+ if (
1471
+ $ platform instanceof DB2Platform
1472
+ || $ platform instanceof OraclePlatform
1473
+ || $ platform instanceof SQLServerPlatform
1474
+ ) {
1475
+ self ::markTestIncomplete (
1476
+ 'Dropping primary key constraint on the currently used database platform is not implemented. ' ,
1477
+ );
1478
+ }
1479
+
1467
1480
$ prototype = new Table ('test_switch_pk_order ' );
1468
1481
$ prototype ->addColumn ('foo_id ' , Types::INTEGER );
1469
1482
$ prototype ->addColumn ('bar_id ' , Types::INTEGER );
@@ -1481,11 +1494,13 @@ public function testSwitchPrimaryKeyOrder(): void
1481
1494
$ schemaManager ->introspectTable ('test_switch_pk_order ' ),
1482
1495
$ table ,
1483
1496
);
1497
+ self ::assertFalse ($ diff ->isEmpty ());
1498
+ $ schemaManager ->alterTable ($ diff );
1484
1499
1485
1500
$ table = $ schemaManager ->introspectTable ('test_switch_pk_order ' );
1486
1501
$ primaryKey = $ table ->getPrimaryKey ();
1487
1502
self ::assertNotNull ($ primaryKey );
1488
- self ::assertSame (['foo_id ' , 'bar_id ' ], array_map ('strtolower ' , $ primaryKey ->getColumns ()));
1503
+ self ::assertSame (['bar_id ' , 'foo_id ' ], array_map ('strtolower ' , $ primaryKey ->getColumns ()));
1489
1504
}
1490
1505
1491
1506
public function testDropColumnWithDefault (): void
0 commit comments