-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Add support for multiple connections managed by migrations #590
Conversation
Is "my_custom_connection" on the example the name of a migration table? This example/naming confuses me |
No, it is the name of a connection (see https://symfony.com/doc/current/reference/configuration/doctrine.html#doctrine-dbal-configuration). The name of the migrations table (of which there is only one per database/connection) is configured in the storage (see https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html#configuration) |
How then does this relate to or fix the issue of the default dropping of the migrations table (the issues you posted this PR to as a solution) Forgive my confusion, I must be missing something |
a9ce3bd
to
953d8c8
Compare
With the latest update, the configuration value is no longer needed. I have verified it and it works correctly for multiple connections now. |
953d8c8
to
7569f07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature looks testable (tests/DependencyInjection/DoctrineMigrationsExtensionTest.php)
56ee74d
to
1c6abc3
Compare
1c6abc3
to
0d9e53d
Compare
So... a return to the pre-break default behavior of assuming/expecting/ignoring a |
@arderyp indeed, the configured migrations table name is filtered in the migrations context. Pre-break this needed to be configured in the DBAL context if I'm not mistaken, which is now done automatically |
Thanks @tobias-93 I'm not entirely clear on your latest comment. Here is how I remember the series of events Years ago I had to configure doctrine migrations to ignore my migrations table. Then eventually DM changed something such that the migrations table that was configured was ignored by default. Then, something broke, and required me to explicitly ignore the migrations tables again, despite them being explicitly configured (and thus eligible to discovering and ignoring). Are you saying that this PR will make it so DM automatically detects configured migration tables and ignores them again, automatically... no need for explicitly filtering them out? If so, that's great! |
@arderyp in fact it is already filtered for the |
Co-authored-by: Grégoire Paris <[email protected]>
Having multiple connections and entity managers, I get the |
Thanks @tobias-93 ! |
References doctrine/migrations#1406, which fixes the filtering of the migrations table for the default connection but not for any other connections.
This PR applies the filter to each of the Doctrine connections.
Not sure what else is required in terms of tests/documentation etc.