migrations
migrations copied to clipboard
doctrine:migrations:diff not working with dbal 4.0 when using multiple schemas.
Bug Report
Platform: MySQL 8.0 doctrine/doctrine-bundle 2.13.0 doctrine/dbal 4.1.1
Since we upgraded to doctrine/dbal 4.0 "bin/console doctrine:migrations:diff --em=schema_name" does re-create all database tables.
The issue seems to be the schema_name. As there are all tables being created with the schema name and dropped again without the schema name:
Up-Migration: CREATE TABLE schema_name.table_name DROP TABLE table_name
Down-Migration: CREATE TABLE table_name DROP TABLE schema_name.table_name
I would expect it to show only new fields in a table. And not drop and create each table.
Note: When I remove schema from the attribute in the entity, it is working. But then of course without the schema prefixed in the up and down migration code. #[ORM\Table(name: 'table_name', schema: 'schema_name')]