POC: Alembic merge heads for git-flow migration reconciliation#7976
Draft
POC: Alembic merge heads for git-flow migration reconciliation#7976
Conversation
Demonstrates that divergent alembic migrations (hotfix on main vs feature on dev) are resolvable via `alembic merge heads`. Three demo migrations show the problem and solution: 1. aaaa11112222 - hotfix migration (landed on main) 2. bbbb33334444 - feature migration (developed on dev) 3. cccc55556666 - merge migration (resolves both heads) This is a proof-of-concept for the git-flow branching proposal. Not intended to merge — just demonstrates the pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7976 +/- ##
=======================================
Coverage 85.04% 85.05%
=======================================
Files 631 631
Lines 41213 41213
Branches 4807 4807
=======================================
+ Hits 35049 35053 +4
+ Misses 5070 5067 -3
+ Partials 1094 1093 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proof-of-concept demonstrating that divergent alembic migrations are resolvable when adopting git-flow.
The scenario:
main(aaaa11112222)dev(bbbb33334444)down_revision, creating two alembic headsThe resolution:
alembic merge headsgenerates a merge migration (cccc55556666) withdown_revision = ("aaaa11112222", "bbbb33334444")Migration chain:
Key takeaway: This is a standard alembic feature. The merge migration has no schema changes — it just unifies the revision graph. Can be automated in CI by detecting
alembic headsreturning >1 result.Test plan
alembic upgrade headin a test DB to confirm execution order🤖 Generated with Claude Code