Skip to content
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

Using alembic downgrade, it's impossible to cancel the initial revision #1326

Closed
vporton opened this issue Oct 17, 2023 · 4 comments
Closed

Comments

@vporton
Copy link

vporton commented Oct 17, 2023

Describe the bug
Using alembic downgrade, it's impossible to cancel the initial revision:

Running alembic downgrade 2ba30ccd01a7, does not drop the tables added by the initial migration 2ba30ccd01a7 (despite downgrade() script is correct).

Expected behavior
Need a way to downgrade to the state before the initial migration (for example, to run the initial migration again after this).

Error
No error message.

Versions.

  • OS: Ubuntu
  • Python: 3.9.16
  • Alembic: 1.12.0
  • SQLAlchemy: 2.0.22
  • Database: Posgres
  • DBAPI: psycopg2
@vporton vporton added the requires triage New issue that requires categorization label Oct 17, 2023
@CaselIT CaselIT added expected behavior and removed requires triage New issue that requires categorization labels Oct 17, 2023
@CaselIT
Copy link
Member

CaselIT commented Oct 17, 2023

Hi,

use base instead. the downgrade command reads as downgrade to the provided revision.
Admittedly the docs could be clearer, like the command line help does not mention base or head.

@zzzeek anything against improving upon the docs / command line help?

@zzzeek
Copy link
Member

zzzeek commented Oct 17, 2023

Sure, though this is documented? literally the section called downgrading illustrates downgrading to base.

@vporton were the docs not clear here?

@zzzeek zzzeek closed this as completed Oct 17, 2023
@CaselIT
Copy link
Member

CaselIT commented Oct 17, 2023

yes, but doing alembic upgrade -h or alembic downgrade -h makes no mention if it

@zzzeek
Copy link
Member

zzzeek commented Oct 17, 2023

"base" is just one of many kinds of identifiers that can be passed, which might not be appropriate in a multi-base environment. there's also relative revision identifiers, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants