@@ -1419,6 +1419,53 @@ public function testDropColumnWithDefault(): void
1419
1419
self ::assertCount (1 , $ columns );
1420
1420
}
1421
1421
1422
+ public function testCanCreateAndDropSchemaThatNeedToBeQuoted (): void
1423
+ {
1424
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1425
+
1426
+ if (! $ platform ->supportsSchemas ()) {
1427
+ self ::markTestSkipped ('The platform does not support schema/namespaces. ' );
1428
+ }
1429
+
1430
+ $ schemaManager = $ this ->connection ->createSchemaManager ();
1431
+ $ schema = $ schemaManager ->introspectSchema ();
1432
+
1433
+ $ schema ->createNamespace ('001_schema ' );
1434
+
1435
+ $ schemaManager = $ this ->connection ->createSchemaManager ();
1436
+ $ schemaManager ->migrateSchema ($ schema );
1437
+ self ::assertContains ('001_schema ' , $ schemaManager ->listSchemaNames ());
1438
+
1439
+ $ schema ->dropNamespace ('001_schema ' );
1440
+ $ schemaManager ->migrateSchema ($ schema );
1441
+ self ::assertNotContains ('001_schema ' , $ schemaManager ->listSchemaNames ());
1442
+ }
1443
+
1444
+ public function testCanCreateAndDropTableFromNamespaceThatNeedToBeQuoted (): void
1445
+ {
1446
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1447
+
1448
+ if (! $ platform ->supportsSchemas ()) {
1449
+ self ::markTestSkipped ('The platform does not support schema/namespaces. ' );
1450
+ }
1451
+
1452
+ $ schemaManager = $ this ->connection ->createSchemaManager ();
1453
+ $ schema = $ schemaManager ->introspectSchema ();
1454
+
1455
+ $ table = $ schema ->createTable ('001_schema.test_quoted_schema ' );
1456
+ $ table ->addColumn ('id ' , Types::INTEGER , ['notnull ' => true ]);
1457
+ $ table ->setPrimaryKey (['id ' ]);
1458
+
1459
+ $ schemaManager = $ this ->connection ->createSchemaManager ();
1460
+ $ schemaManager ->migrateSchema ($ schema );
1461
+ self ::assertContains ('001_schema ' , $ schemaManager ->listSchemaNames ());
1462
+ self ::assertContains ('001_schema.test_quoted_schema ' , $ schemaManager ->listTableNames ());
1463
+
1464
+ $ schema ->dropTable ('001_schema.test_quoted_schema ' );
1465
+ $ schemaManager ->migrateSchema ($ schema );
1466
+ self ::assertNotContains ('001_schema.test_quoted_schema ' , $ schemaManager ->listTableNames ());
1467
+ }
1468
+
1422
1469
/** @param list<Table> $tables */
1423
1470
protected function findTableByName (array $ tables , string $ name ): ?Table
1424
1471
{
0 commit comments