Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jochen-jung opened this issue Sep 30, 2024 · 0 comments

Comments

@jochen-jung
Copy link

jochen-jung commented Sep 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant