This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new ae505be7a87 Fix DB downgrade to Airflow 2 when fab tables exists
(#55738)
ae505be7a87 is described below
commit ae505be7a8735e04bf5dd999412d6f7e941ccc3d
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Tue Sep 16 22:29:32 2025 +0100
Fix DB downgrade to Airflow 2 when fab tables exists (#55738)
We should continue downgrade if fab ab_user table exists even when fab
version table does not exist
(cherry picked from commit 5cdbdc6712b2162f81b39173ba58133850c7b03f)
---
airflow-core/src/airflow/utils/db.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/airflow-core/src/airflow/utils/db.py
b/airflow-core/src/airflow/utils/db.py
index 4a6d96dbffc..2cfb7a4eb20 100644
--- a/airflow-core/src/airflow/utils/db.py
+++ b/airflow-core/src/airflow/utils/db.py
@@ -1255,6 +1255,14 @@ def _handle_fab_downgrade(*, session: Session) -> None:
fab_version,
)
return
+ connection = settings.engine.connect()
+ insp = inspect(connection)
+ if not fab_version and insp.has_table("ab_user"):
+ log.info(
+ "FAB migration version not found, but FAB tables exist. "
+ "FAB provider is not required for downgrade.",
+ )
+ return
# FAB db version is different or not found - require the FAB provider
try: