iting0321 commented on code in PR #64838:
URL: https://github.com/apache/airflow/pull/64838#discussion_r3045412762
##########
airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py:
##########
@@ -188,19 +189,30 @@ def upgrade() -> None:
dialect_name = conn.dialect.name
if dialect_name == "sqlite":
- conn.execute(sa.text("PRAGMA foreign_keys=OFF"))
-
- with op.batch_alter_table("deadline", schema=None) as batch_op:
- batch_op.add_column(sa.Column("deadline_alert_id", sa.Uuid(),
nullable=True))
- batch_op.add_column(sa.Column("created_at", UtcDateTime,
nullable=True))
- batch_op.add_column(sa.Column("last_updated_at", UtcDateTime,
nullable=True))
- batch_op.create_foreign_key(
- batch_op.f("deadline_deadline_alert_id_fkey"),
- "deadline_alert",
- ["deadline_alert_id"],
- ["id"],
- ondelete="SET NULL",
- )
+ with disable_sqlite_fkeys(op):
Review Comment:
Fixed.
Both functions now wrap all batch operations in a single with
`disable_sqlite_fkeys(op)` block. Since the helper is a no-op for non-SQLite,
the else branch is no longer needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]