As far as I know, a migration will only run on one database at the time... Is this not the case for you?
I thought you have to add --database=myotherconnection
to get migrations to run for a non-default connection.
I will look into building a solution. The --database flag allows you to toggle the migrations for a non-default connection but does not allow you to choose which migrations are applied to which db.
Thank you for you assistance anyhow. It's appreciated.
You can do this:
Schema::connection('other_database')->create(....)
You can create different folders for some of the migrations such as shared
or however you want and use the --path
option when running migrations. Then, only the migrations in that folder will run.
For example I use a folder named tenants
to store all account migrations (tables that hold all the users data) for a SaaS app. Then I use the default migrations
folder to store things relating to authentication, password reminders, and anything else related to all user accounts.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community