You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If you use the Messenger Doctrine transports, you'll probably want to use the doctrine.dbal.schema_filter config set to, for example, ~^(?!messenger_messages)~ so that migrations doesn't try to drop your "extra" table. However, I found out that the auto_setup functionality in the Doctrine transport uses the SchemaSynchronizer, which is aware of your "schema_filter" config. In other words, it gets a "list" of your existing tables in a way that respects schema_filter, which means that it thinks this table doesn't exist. It then tries to recreate it.
Possible Solution
I'm not sure how to best solve it. We could "hack" the connection configuration before/after using the database synchronizer (to remove the schema filter, then re-add)... but that's ugly.
…transport (vincenttouzet)
This PR was merged into the 4.3 branch.
Discussion
----------
[Messenger] Disable the SchemaAssetsFilter when setup the transport
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31623
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Commits
-------
8cbb8f8 [Messenger] Disable the SchemaAssetsFilter when setup the transport
Symfony version(s) affected: 4.3
Description
If you use the Messenger Doctrine transports, you'll probably want to use the
doctrine.dbal.schema_filter
config set to, for example,~^(?!messenger_messages)~
so that migrations doesn't try to drop your "extra" table. However, I found out that theauto_setup
functionality in the Doctrine transport uses theSchemaSynchronizer
, which is aware of your "schema_filter" config. In other words, it gets a "list" of your existing tables in a way that respects schema_filter, which means that it thinks this table doesn't exist. It then tries to recreate it.The problem is here: https://github.com/doctrine/dbal/blob/cdc12afe378722b649ce07f1cb2d990fe43025e0/lib/Doctrine/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizer.php#L42
Which then ultimately, in
listTableNames()
, calls this:https://github.com/doctrine/dbal/blob/cdc12afe378722b649ce07f1cb2d990fe43025e0/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php#L225
Possible Solution
I'm not sure how to best solve it. We could "hack" the connection configuration before/after using the database synchronizer (to remove the schema filter, then re-add)... but that's ugly.
ping @vincenttouzet
The text was updated successfully, but these errors were encountered: