7
7
use Doctrine \DBAL \Exception ;
8
8
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
9
9
use Doctrine \DBAL \Schema \Comparator ;
10
- use Doctrine \DBAL \Schema \Schema ;
11
10
use Doctrine \DBAL \Schema \Table ;
12
11
use Doctrine \DBAL \Tests \FunctionalTestCase ;
13
12
use Doctrine \DBAL \Types \Types ;
@@ -37,22 +36,19 @@ public function testEmptyDiffRegardlessOfForeignTableQuotes(
37
36
self ::markTestSkipped ('Platform does not support schemas. ' );
38
37
}
39
38
40
- $ this ->dropTableIfExists ('other_schema.other_table ' );
41
- $ this ->dropTableIfExists ('other_schema."user" ' );
42
- $ this ->dropSchemaIfExists ('other_schema ' );
39
+ $ this ->dropAndCreateSchema ('other_schema ' );
43
40
44
41
$ tableForeign = new Table ($ foreignTableName );
45
42
$ tableForeign ->addColumn ('id ' , 'integer ' );
46
43
$ tableForeign ->setPrimaryKey (['id ' ]);
44
+ $ this ->dropAndCreateTable ($ tableForeign );
47
45
48
46
$ tableTo = new Table ('other_schema.other_table ' );
49
47
$ tableTo ->addColumn ('id ' , 'integer ' );
50
48
$ tableTo ->addColumn ('user_id ' , 'integer ' );
51
49
$ tableTo ->setPrimaryKey (['id ' ]);
52
- $ tableTo ->addForeignKeyConstraint ($ tableForeign , ['user_id ' ], ['id ' ], []);
53
-
54
- $ schemaTo = new Schema ([$ tableForeign , $ tableTo ]);
55
- $ this ->schemaManager ->createSchemaObjects ($ schemaTo );
50
+ $ tableTo ->addForeignKeyConstraint ($ tableForeign , ['user_id ' ], ['id ' ]);
51
+ $ this ->dropAndCreateTable ($ tableTo );
56
52
57
53
$ schemaFrom = $ this ->schemaManager ->introspectSchema ();
58
54
$ tableFrom = $ schemaFrom ->getTable ('other_schema.other_table ' );
@@ -88,12 +84,8 @@ public function testDropIndexInAnotherSchema(callable $comparatorFactory, string
88
84
self ::markTestSkipped ('Platform does not support schemas. ' );
89
85
}
90
86
91
- $ this ->dropTableIfExists ('test_drop_index_schema.some_table ' );
92
- $ this ->dropSchemaIfExists ('test_drop_index_schema ' );
93
- $ this ->connection ->executeStatement ('CREATE SCHEMA test_drop_index_schema ' );
94
- $ this ->dropTableIfExists ('"case".some_table ' );
95
- $ this ->dropSchemaIfExists ('"case" ' );
96
- $ this ->connection ->executeStatement ('CREATE SCHEMA "case" ' );
87
+ $ this ->dropAndCreateSchema ('other_schema ' );
88
+ $ this ->dropAndCreateSchema ('case ' );
97
89
98
90
$ tableFrom = new Table ($ tableName );
99
91
$ tableFrom ->addColumn ('id ' , Types::INTEGER );
@@ -119,8 +111,8 @@ public static function dataDropIndexInAnotherSchema(): iterable
119
111
foreach (
120
112
[
121
113
'default schema ' => ['some_table ' ],
122
- 'unquoted schema ' => ['test_drop_index_schema .some_table ' ],
123
- 'quoted schema ' => ['"test_drop_index_schema ".some_table ' ],
114
+ 'unquoted schema ' => ['other_schema .some_table ' ],
115
+ 'quoted schema ' => ['"other_schema ".some_table ' ],
124
116
'reserved schema ' => ['case.some_table ' ],
125
117
] as $ testScenario => $ testArguments
126
118
) {
0 commit comments