Closed wxy2077 closed 3 months ago
That really is an anti-pattern what you're doing there. You're building a potentially inconsistent history of migrations.
Merge A into B before migrating. That way branch B will have both a1.sql
and b1.sql
.
Because my colleagues and I are developing different tasks synchronously, but using the same test db, the online time of the
tasks is different, although they will be merged into the master branch eventually, but in the development process, if the
colleague's branch has not been tested, I cannot merge his branch, which leads to the problem of SQL migration.
You're all using the same database server to test your changes against? Isn't that a source of constant conflicts?
Well, then we have to change the database. Thank you for your reply.
Question: When different branches have different migration statements, an error will be reported when migrating at the same time.
Example:
a1.sql
B branch migrate sql: b1.sql
dev-mysql: dialect: mysql datasource: root:123456@tcp(127.0.0.1:3306)/example?parseTime=true dir: migrate/mysql table: migrations
Migration failed: Unable to create migration plan because of a1.sql: unknown migration in database