Skip to content

SQLSTATE[HY000]: General error: 1 table messenger_messages already exists #103

Open
@lsv

Description

@lsv

After an upgrade from symfony 4.4 to symfony 5.1 with all the doctrine dependencies, and also an remove of liip/functional-test-bundle and instead install of liip/test-fixtures-bundle

Some dependencies that have been upgraded is

doctrine/doctrine-migrations-bundle
doctrine/doctrine-fixtures-bundle
symfony/messenger

My tests began to output a lot of SQLSTATE[HY000]: General error: 1 table messenger_messages already exists all over the place.

Now for my migrations to not add messenger_messages table I have the following doctrine config

# config/packages/doctrine.yaml
doctrine:
    dbal:
        connections:
            default:
                schema_filter: ~^(?!messenger_messages)~

So to fix my table already exists I had to add the following to my doctrine test yaml file

# config/packages/test/doctrine.yaml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                schema_filter: ~

And now my tests are running fine.

Im not actually sure this is a bug in either doctrine or liip, but just wanted to add it somewhere, so it can be googled - because I had no relevant google results coming up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions