Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[FEATURE] Database Migrations - Handling multiple migrations with different connections #1587
Labels
Comments
For now you can group migrations by connection in different folders and create a bash script to migrate them all, but PRs are welcome. :) |
我准备完成这个 PR,查看源代码之后,目前的思路是这样。
假设我的 migration 分别是
经过测试,指定库进行表迁移是可行,但 migrations 这张表只会在第一个数据库生成,并不会在第二个数据库生成,数据库并不是独立的 migrations 。 所以想请教一下,这块需要怎么样继续改动呢?是否有需要让 migraitons 在不同的库生成呢? 谢谢! |
@huangzhhui 来看看把 这块我不熟。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I got few migrations each referring a different connection. migrate:fresh, migrate:refresh doesn't handle this scenario since they operate on the default connection or in the specific connection passed via --database param.
Describe the solution you'd like
The simplest solution can be to process only migrations that has the $connection property set to the default connection or in the specific connection passed via --database param.
A better solution could be iterate the distinct connections defined in the migrations and process them according.