Skip to content

Commit

Permalink
Don't run pre-migration checks for downgrade (#23634)
Browse files Browse the repository at this point in the history
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 authored May 11, 2022
1 parent 5d8cda8 commit 9ab9cd4
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions airflow/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 9ab9cd4

Please sign in to comment.