Skip to content

Commit 550053d

Browse files
github-actions[bot]Lee-W
authored andcommitted
[v3-2-test] fix(migrations): move UPDATEs inside disable_sqlite_fkeys in migration 0097 (#64876) (#64940)
(cherry picked from commit 666879c) Co-authored-by: Wei Lee <weilee.rx@gmail.com>
1 parent b3c635c commit 550053d

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

airflow-core/src/airflow/migrations/versions/0097_3_2_0_enforce_log_event_and_dag_is_stale_not_null.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@
4040

4141
def upgrade():
4242
"""Bring existing deployments in line with 0010 and 0067."""
43-
# Ensure `log.event` can safely transition to NOT NULL.
44-
op.execute("UPDATE log SET event = '' WHERE event IS NULL")
45-
46-
# Make sure DAG rows that survived the old 0067 path are not NULL.
47-
op.execute("UPDATE dag SET is_stale = false WHERE is_stale IS NULL")
48-
4943
with disable_sqlite_fkeys(op):
44+
op.execute("UPDATE log SET event = '' WHERE event IS NULL")
45+
op.execute("UPDATE dag SET is_stale = false WHERE is_stale IS NULL")
46+
5047
with op.batch_alter_table("log") as batch_op:
5148
batch_op.alter_column("event", existing_type=sa.String(60), nullable=False)
5249

0 commit comments

Comments
 (0)