Laravel has multiple databases in the migration folder. #48029
-
In the migration folder, only single databases were handled, like MySQL and other databases (AWS RDS), but now different architecture databases are used at the same time, so migration problems arise. My idea is database/migrations, folders, or it helps to manage multi-database migrations and virtual structures. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I think it's a good idea. I'd suggest that each connection has a folder. So if you have a connection 'production' and a connection 'static-data' for data that almost never changes, we'd have migrate check the following folders for migrations and executes them per connection.
Of course, the ones in the migrations root go to your default connection, for backward compatibility. |
Beta Was this translation helpful? Give feedback.
-
You can add migrations for multiple databases using https://laravel.com/docs/10.x/migrations#setting-the-migration-connection |
Beta Was this translation helpful? Give feedback.
You can tell the migrate command to look at multiple paths:
framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php
Line 28 in 5a7f2b4