File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -878,7 +878,7 @@ public function getDropSchemaSQL(array $classes)
878
878
{
879
879
$ schema = $ this ->getSchemaFromMetadata ($ classes );
880
880
881
- $ deployedSchema = $ this ->schemaManager -> createSchema ();
881
+ $ deployedSchema = $ this ->introspectSchema ();
882
882
883
883
foreach ($ schema ->getTables () as $ table ) {
884
884
if (! $ deployedSchema ->hasTable ($ table ->getName ())) {
@@ -974,7 +974,7 @@ private function createSchemaForComparison(Schema $toSchema): Schema
974
974
$ previousFilter = $ config ->getSchemaAssetsFilter ();
975
975
976
976
if ($ previousFilter === null ) {
977
- return $ this ->schemaManager -> createSchema ();
977
+ return $ this ->introspectSchema ();
978
978
}
979
979
980
980
// whitelist assets we already know about in $toSchema, use the existing filter otherwise
@@ -985,10 +985,19 @@ private function createSchemaForComparison(Schema $toSchema): Schema
985
985
});
986
986
987
987
try {
988
- return $ this ->schemaManager -> createSchema ();
988
+ return $ this ->introspectSchema ();
989
989
} finally {
990
990
// restore schema assets filter
991
991
$ config ->setSchemaAssetsFilter ($ previousFilter );
992
992
}
993
993
}
994
+
995
+ private function introspectSchema (): Schema
996
+ {
997
+ $ method = method_exists ($ this ->schemaManager , 'introspectSchema ' )
998
+ ? 'introspectSchema '
999
+ : 'createSchema ' ;
1000
+
1001
+ return $ this ->schemaManager ->$ method ();
1002
+ }
994
1003
}
Original file line number Diff line number Diff line change 69
69
<referencedMethod name =" Doctrine\DBAL\Connection::getSchemaManager" />
70
70
<referencedMethod name =" Doctrine\DBAL\Platforms\AbstractPlatform::getGuidExpression" />
71
71
<referencedMethod name =" Doctrine\DBAL\Platforms\AbstractPlatform::supportsForeignKeyConstraints" />
72
- <!-- Remove on 2.14.x -->
73
- <referencedMethod name =" Doctrine\DBAL\Schema\AbstractSchemaManager::createSchema" />
74
- <referencedMethod name =" Doctrine\DBAL\Schema\Index::isFullfilledBy" />
75
- <referencedMethod name =" Doctrine\DBAL\Schema\Table::changeColumn" />
76
- <referencedMethod name =" Doctrine\DBAL\Schema\Table::hasPrimaryKey" />
77
72
<!-- Remove on 3.0.x -->
78
73
<referencedMethod name =" Doctrine\DBAL\Connection::getEventManager" />
79
74
<referencedMethod name =" Doctrine\DBAL\Schema\Schema::visit" />
You can’t perform that action at this time.
0 commit comments