This is an automated email from the ASF dual-hosted git repository.
weilee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 666879c6735 fix(migrations): move UPDATEs inside disable_sqlite_fkeys
in migration 0097 (#64876)
666879c6735 is described below
commit 666879c6735a08296e4d407709f50a0efe894eff
Author: Wei Lee <[email protected]>
AuthorDate: Thu Apr 9 11:24:03 2026 +0800
fix(migrations): move UPDATEs inside disable_sqlite_fkeys in migration 0097
(#64876)
---
.../0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
a/airflow-core/src/airflow/migrations/versions/0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py
b/airflow-core/src/airflow/migrations/versions/0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py
index 49fb4bcc3f7..5af4f7be74d 100644
---
a/airflow-core/src/airflow/migrations/versions/0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py
+++
b/airflow-core/src/airflow/migrations/versions/0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py
@@ -40,13 +40,10 @@ airflow_version = "3.2.0"
def upgrade():
"""Bring existing deployments in line with 0010 and 0067."""
- # Ensure `log.event` can safely transition to NOT NULL.
- op.execute("UPDATE log SET event = '' WHERE event IS NULL")
-
- # Make sure DAG rows that survived the old 0067 path are not NULL.
- op.execute("UPDATE dag SET is_stale = false WHERE is_stale IS NULL")
-
with disable_sqlite_fkeys(op):
+ op.execute("UPDATE log SET event = '' WHERE event IS NULL")
+ op.execute("UPDATE dag SET is_stale = false WHERE is_stale IS NULL")
+
with op.batch_alter_table("log") as batch_op:
batch_op.alter_column("event", existing_type=sa.String(60),
nullable=False)