Downgrading to depends_on migration causes "Requested revision ... overlaps with other requested revisions ..." issue #1373
Labels
PRs (with tests!) welcome
use case
not quite a feature and not quite a bug, something we just didn't think of
versioning model
Describe the bug
When downgrading to a migration (b1) that is the depends_on of a branched migration (a1), the
alembic_version
table incorrectly includes both a1 and b1 when it should just have a1. This bug then prevents further upgrades from working, like upgrading to a merge migration (bmerge) that merges a1 and b1.Expected behavior
Downgrading to b1 should result in a1 being in the alembic_version table. From there, upgrading to bmerge should work as expected.
To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.
The following patch can be applied:
Error
If the failing assertion is commented out, we see that our heads state is corrupt:
Versions.
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered: