liip / liip/LiipTestFixturesBundle

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

Open
#103 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config/packages/doctrine.yaml and config/packages/test/doctrine.yaml, then reproduce the test failure after the Symfony and Doctrine dependency upgrades. Determine whether the bundle or its documentation should handle the messenger_messages schema conflict, and confirm the tests run without requiring the reported workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
database, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.