Skip to content

Handling multiple merge heads in Alembic migrations #1696

Discussion options

You must be logged in to vote

Hi,

I don't think there is anything integrated in alembic, but you can create another merge migration if you prefer.

Regarding alternative workflow, at work we usually manually "rebase" migrations.
Say you have this case: two feature branches create a new migrations in parallel, both starting from Mx, for example Mx -> Ma and Mx -> Mb. After one of the feature branches is merged, let's say the one with migration Mb, we would merge develop into the remaining feature branch and "rebase" Ma to be after Mb, so that the actual migrations history once merged in develop would be Mx -> Mb -> Ma. This is done manually by modifying the down_revision of Ma to point to Mb instead of Mx.

We found that…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZuebeyirEser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants