Skip to content

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

Open
@jochen-jung

Description

@jochen-jung

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions