Skip to content
Permalink
Browse files
Don't run pre-migration checks for downgrade (#23634)
These checks are only make sense for upgrades.  Generally they exist to resolve referential integrity issues etc before adding constraints.  In the downgrade context, we generally only remove constraints, so it's a non-issue.
  • Loading branch information
dstandish committed May 11, 2022
1 parent 5d8cda8 commit 9ab9cd47cff5292c3ad602762ae3e371c992ea92
Showing 1 changed file with 0 additions and 10 deletions.
@@ -1504,16 +1504,6 @@ def downgrade(*, to_revision, from_revision=None, show_sql_only=False, session:
log.info("Attempting downgrade to revision %s", to_revision)
config = _get_alembic_config()

errors_seen = False
for err in _check_migration_errors(session=session):
if not errors_seen:
log.error("Automatic migration failed. You may need to apply downgrades manually. ")
errors_seen = True
log.error("%s", err)

if errors_seen:
exit(1)

with create_global_lock(session=session, lock=DBLocks.MIGRATIONS):
if show_sql_only:
log.warning("Generating sql scripts for manual migration.")

0 comments on commit 9ab9cd4

Please sign in to comment.