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
Using Multiple Database in a single Symfony Application.
We need to trigger the MigrateCommand x times for x databases from a cron/hook when deploying a new version.
Current behavior
Note : Running this Command with the --conn option seems to not works.
So we use the --em option.
When calling the MigrateCommand multiple times FROM Command/Code the connection will be:
Because of this, the connection will always be the first "implemented".
In the end, calling this command in a loop and changing the connection/entityManager at each iteration won't work as untended.
Output
a. First loop : WARNING! You are about to execute a migration in database "client1" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]
b. Second loop: WARNING! You are about to execute a migration in database "client1" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]
Expected behavior
The first loop should be client1 and the second client2.
Note : Running single command from CLI is working php bin/console d:m:m --em=client1
or php bin/console d:m:m --em=client2
Bug Report
Summary
Using Multiple Database in a single Symfony Application.
We need to trigger the MigrateCommand x times for x databases from a cron/hook when deploying a new version.
Current behavior
When calling the MigrateCommand multiple times FROM Command/Code the connection will be:
getted
migrations/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php
Line 132 in 2f4b149
AND setted at the same time (if undefined)
migrations/lib/Doctrine/Migrations/DependencyFactory.php
Lines 158 to 168 in 2f4b149
Because of this, the connection will always be the first "implemented".
In the end, calling this command in a loop and changing the connection/entityManager at each iteration won't work as untended.
How to reproduce
a. First loop :
WARNING! You are about to execute a migration in database "client1" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]
b. Second loop:
WARNING! You are about to execute a migration in database "client1" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]
Expected behavior
The first loop should be
client1
and the secondclient2
.Doctrine config
php bin/console debug:config doctrine
The text was updated successfully, but these errors were encountered: