From 3ffefa93b086d7da0135be07b577acf5cef1aa33 Mon Sep 17 00:00:00 2001 From: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:39:05 +0530 Subject: [PATCH] [v3-0-test] Fix db downgrade check condition (#52982) * fix rollback from airflow3 * use fab for test * amend * fix test * revert condition fix and add shortcut if revisions are same * updating revision to 2.10.3 in condition * remove fab from tests (cherry picked from commit d4585543477835e0c33aadbd64789d60e787390e) Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com> --- airflow-core/src/airflow/utils/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/utils/db.py b/airflow-core/src/airflow/utils/db.py index 4ab7226fcb487..f091f0868b0d5 100644 --- a/airflow-core/src/airflow/utils/db.py +++ b/airflow-core/src/airflow/utils/db.py @@ -1210,7 +1210,7 @@ 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() # Check if downgrade is less than 3.0.0 and requires that `ab_user` fab table is present - if _revision_greater(config, _REVISION_HEADS_MAP["3.0.0"], to_revision): + if _revision_greater(config, _REVISION_HEADS_MAP["2.10.3"], to_revision): unitest_mode = conf.getboolean("core", "unit_test_mode") if unitest_mode: try: