migrations icon indicating copy to clipboard operation
migrations copied to clipboard

doctrine:migrations:diff not working with dbal 4.0 when using multiple schemas.

Open jochen-jung opened this issue 1 year ago • 0 comments

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')]

jochen-jung avatar Sep 30 '24 13:09 jochen-jung