iting0321 commented on code in PR #64838:
URL: https://github.com/apache/airflow/pull/64838#discussion_r3106831051
##########
airflow-core/src/airflow/migrations/versions/0082_3_1_0_make_bundle_name_not_nullable.py:
##########
@@ -61,61 +61,48 @@ def upgrade():
('dags-folder');
""")
)
- if dialect_name == "sqlite":
- op.execute(text("PRAGMA foreign_keys=OFF"))
- op.execute(
- text("""
- INSERT OR IGNORE INTO dag_bundle (name) VALUES
- ('example_dags'),
- ('dags-folder');
- """)
- )
- conn = op.get_bind()
- with ignore_sqlite_value_error(), op.batch_alter_table("dag", schema=None)
as batch_op:
- conn.execute(
- text(
- """
- UPDATE dag
- SET bundle_name =
- CASE
- WHEN fileloc LIKE '%/airflow/example_dags/%' THEN
'example_dags'
- ELSE 'dags-folder'
- END
- WHERE bundle_name IS NULL
- """
+ with disable_sqlite_fkeys(op):
+ if dialect_name == "sqlite":
Review Comment:
fixed
--
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]