File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 12
12
use Doctrine \Migrations \Generator \Exception \NoChangesDetected ;
13
13
use Doctrine \Migrations \Provider \SchemaProvider ;
14
14
15
+ use function method_exists ;
15
16
use function preg_match ;
16
17
use function strpos ;
17
18
use function substr ;
@@ -63,6 +64,18 @@ static function ($assetName) use ($filterExpression) {
63
64
64
65
$ toSchema = $ this ->createToSchema ();
65
66
67
+ // prior to DBAL 4.0, the schema name was set to the first element in the search path,
68
+ // which is not necessarily the default schema name
69
+ if (
70
+ ! method_exists ($ this ->schemaManager , 'getSchemaSearchPaths ' )
71
+ && $ this ->platform ->supportsSchemas ()
72
+ ) {
73
+ $ defaultNamespace = $ toSchema ->getName ();
74
+ if ($ defaultNamespace !== '' ) {
75
+ $ toSchema ->createNamespace ($ defaultNamespace );
76
+ }
77
+ }
78
+
66
79
$ comparator = $ this ->schemaManager ->createComparator ();
67
80
68
81
$ upSql = $ this ->platform ->getAlterSchemaSQL ($ comparator ->compareSchemas ($ fromSchema , $ toSchema ));
You can’t perform that action at this time.
0 commit comments