Skip to content

Dropping alembic_version table inside migration script fails #998

Discussion options

You must be logged in to vote

Alembic relies upon the configured alembic_version table in order to track what migrations it needs to run. It's not possible to have a migration that deletes the table itself.

For Alembic's management of the "alembic_version" table, on a clean database Alembic will create this table first if it does not exist, before it runs migrations. Then, if you run a downgrade operation all the way to the "base", Alembic automatically deletes the table. So if you were to downgrade a datbase all the way down, the table is deleted for you.

Beyond that, the problem being solved isn't clear to me (specifically "The target I have that represents the base at the moment, does not contain the alembic_versio…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@baileythegreen
Comment options

@zzzeek
Comment options

@baileythegreen
Comment options

@zzzeek
Comment options

Answer selected by baileythegreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants