You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/05/17 07:46:24 UTC
[airflow] 16/20: Don't run pre-migration checks for downgrade (#23634)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit d836cd141dbcfe1b6166c561cdc21ace829e0d14
Author: Daniel Standish <15...@users.noreply.github.com>
AuthorDate: Wed May 11 09:08:06 2022 -0700
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.
(cherry picked from commit 9ab9cd47cff5292c3ad602762ae3e371c992ea92)
---
airflow/utils/db.py | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index 730757694d..e624650dae 100644
--- a/airflow/utils/db.py
+++ b/airflow/utils/db.py
@@ -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.")