-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alembic >= 1.6.0 throws "Not a valid downgrade target from current heads". #839
Comments
hi there - This looks very similar to #838 just released in 1.6.1 but seems to be a different trace. Like that issue, I can't reproduce here without a self contained example (The code posted seems to be an out of context fragment, for example I dont know what ConfigLayer is also I don't have a mailman environment here). I would need to see the current heads and alembic revision instruction being made - most ideally in the form of "alembic downgrade " from a given head. thanks! |
@simonbowly do we have a separate codepath when more than one branch is in play? this would then be the same issue as #838 but only caught when there's more than one head, is that it? |
The migrations involved are all at https://gitlab.com/mailman/mailman/-/tree/master/src/mailman/database/alembic/versions I don't think ConfigLayer is relevant, but it is at https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/testing/layers.py |
Looks like there's a behaviour change in running No revisions are performed in either case, as would be expected, but the new unexpected behaviour is an error rather than just a silent exit. In <1.6
In >= 1.6
|
Simon Bowly has proposed a fix for this issue in the master branch: Move empty downgrade revisions check to make it specific to branch filtering case as intended. https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2811 |
I confirm that the patch at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2811 fixes my issue. Thank you. |
1.6.2 is released |
Your responsiveness is amazing. I thought I was good, but you rock! THANK YOU! |
Describe the bug
Attempting to test downgrading of all revisions throws alembic.script.revision.RevisionError: Not a valid downgrade target from current heads.
Expected behavior
Downgrading should succeed.
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.
This test code which passes with alembic < 1.6.0 fails on 1.6.0 and 1.6.1
The contents of mailman.database.alembic.init.py are:
Error
Versions.
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered: