You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure SQL Database (reproduces on docker MSSQL Server 2019)
sqlsrv driver
DBAL 3.5.3
DoctrineMigrationsBundle 3.2.2
doctrine migrations 3.5.5
ORM 2.14.1
Summary
Perhaps I've stumbled upon unsupported usage of schema_filter. If so, please let me know. Please note that this example is using a MSSQL database, which seems to use "schemas" much differently than other platforms. I have not tested on other platforms.
I'm trying to use the schema_filter config parameter to limit my project to one specific schema (instead of excluding a number of schemas). For example:
For the purposes of this bug report, assume that my_table already exists in my_schema in the database.
When executing bin/console doctrine:migrations:diff, I would expect a blank migration to be created, since there are no changes needed, however a migration is being created containing the following:
$this->addSql('DROP TABLE my_schema.my_table');
It appears that the issue is likely caused by this line in DiffGenerator::createToSchema():
When $tableName is "my_schema.my_table", then resolveTableName() will remove "my_schema." from the name. RegexSchemaAssetFilter will then return false because it does not match the schema_filter in the config, thus making the migration drop the table.
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
Perhaps I've stumbled upon unsupported usage of schema_filter. If so, please let me know. Please note that this example is using a MSSQL database, which seems to use "schemas" much differently than other platforms. I have not tested on other platforms.
I'm trying to use the
schema_filter
config parameter to limit my project to one specific schema (instead of excluding a number of schemas). For example:All entities have been defined with both a schema and table name, for example:
For the purposes of this bug report, assume that my_table already exists in my_schema in the database.
When executing
bin/console doctrine:migrations:diff
, I would expect a blank migration to be created, since there are no changes needed, however a migration is being created containing the following:It appears that the issue is likely caused by this line in DiffGenerator::createToSchema():
When
$tableName
is "my_schema.my_table", thenresolveTableName()
will remove "my_schema." from the name. RegexSchemaAssetFilter will then return false because it does not match theschema_filter
in the config, thus making the migration drop the table.The text was updated successfully, but these errors were encountered: