We have a team of 6 developers all trying to contribute schema changes in parallel and we often collide with merge conflicts.
main is updated, with the newest migration being 0030
6 devs create 6 new feature branches from main and each of them thinks their next migration is 0031
The first dev to have their PR approved and merged "wins", while the remaining devs all have a merge conflict and need to rebase. All 5 remaining devs rebase their work and continue with migration 0032
The merge-one-rebase-many cycle repeats
The 6 devs are all making changes in unrelated areas of the DB, so aside from the conflicts in migrations/meta/_journal.json the work is actually isolated.
Compare this workflow to the Rails ActiveRecord migration pattern, which uses a UTC timestamp as a unique number. In that workflow, the chance of a merge conflict with 6 devs is much less.
From what I can see in the source, both Drizzle and Rails would apply missing migrations in the correct order, skipping migrations already applied. So using the Rails approach would be a nice DX improvement.
Our team still likes using Drizzle, and we will continue to just rebase and workaround this, but I thought I'd highlight an unexpected pain point that we are hitting as development increases.
Describe what you want
We have a team of 6 developers all trying to contribute schema changes in parallel and we often collide with merge conflicts.
main
is updated, with the newest migration being0030
main
and each of them thinks their next migration is0031
0032
The 6 devs are all making changes in unrelated areas of the DB, so aside from the conflicts in
migrations/meta/_journal.json
the work is actually isolated.Compare this workflow to the Rails ActiveRecord migration pattern, which uses a UTC timestamp as a unique number. In that workflow, the chance of a merge conflict with 6 devs is much less.
From what I can see in the source, both Drizzle and Rails would apply missing migrations in the correct order, skipping migrations already applied. So using the Rails approach would be a nice DX improvement.
Our team still likes using Drizzle, and we will continue to just rebase and workaround this, but I thought I'd highlight an unexpected pain point that we are hitting as development increases.