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
The documentation states that you can create a migration connection by using the $connection property. I have done this with 70 migrations in my project and can confirm that the default connection was used for all migrations.
Steps To Reproduce:
Create a second database
Create a new migration that you wish to use with the second database
Add protected $connection = 'second_database'; to the top of your migration.
Run migration.
The migration should use the connection specified in the $connection property, but it will ignore it and use the default connection.
The text was updated successfully, but these errors were encountered:
Commit that changed the behavior starting in laravel/framework 7.0.0: f4bd05f
Pull request #35842 was rejected earlier this year but I think only because it lacked a bug report description and the addition of tests to cover documented behavior.
Either that pull request needs to be properly re-submitted to the 8.x branch or the docs should be updated to suggest the answer given in #31060: call Schema::connection('secondary_database')->create(...).
Description:
The documentation states that you can create a migration connection by using the $connection property. I have done this with 70 migrations in my project and can confirm that the default connection was used for all migrations.
Steps To Reproduce:
protected $connection = 'second_database';
to the top of your migration.The migration should use the connection specified in the
$connection
property, but it will ignore it and use the default connection.The text was updated successfully, but these errors were encountered: