File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,24 @@ protected function createSchemaManager(): AbstractSchemaManager
82
82
83
83
public function table (string $ tableName ): self
84
84
{
85
- $ tableName = preg_replace ('~^.+\.~ ' , '' , $ tableName );
86
-
87
- $ this ->table = new Table ($ this ->getDatabasePlatform ()->quoteIdentifier ($ tableName ));
85
+ $ table = new Table ('0.0 ' );
88
86
if ($ this ->getDatabasePlatform () instanceof MySQLPlatform) {
89
- $ this ->table ->addOption ('charset ' , 'utf8mb4 ' );
87
+ $ table ->addOption ('charset ' , 'utf8mb4 ' );
88
+ }
89
+
90
+ // fix namespaced table name split for MSSQL/PostgreSQL
91
+ // https://github.com/doctrine/dbal/blob/3.3.7/src/Schema/AbstractAsset.php#L55
92
+ $ lastDotPos = strrpos ($ tableName , '. ' );
93
+ if ($ lastDotPos !== false ) {
94
+ \Closure::bind (function () use ($ table , $ tableName , $ lastDotPos ) {
95
+ $ table ->_quoted = true ;
96
+ $ table ->_namespace = substr ($ tableName , 0 , $ lastDotPos );
97
+ $ table ->_name = substr ($ tableName , $ lastDotPos + 1 );
98
+ }, null , Table::class)();
90
99
}
91
100
101
+ $ this ->table = $ table ;
102
+
92
103
return $ this ;
93
104
}
94
105
You can’t perform that action at this time.
0 commit comments