ephraimbuddy commented on code in PR #58130:
URL: https://github.com/apache/airflow/pull/58130#discussion_r2513191033


##########
airflow-core/src/airflow/migrations/versions/0082_3_1_0_make_bundle_name_not_nullable.py:
##########
@@ -42,59 +43,60 @@
 
 def upgrade():
     """Make bundle_name not nullable."""
-    dialect_name = op.get_bind().dialect.name
-    if dialect_name == "postgresql":
-        op.execute(
-            text("""
-                INSERT INTO dag_bundle (name) VALUES
-                    ('example_dags'),
-                    ('dags-folder')
-                ON CONFLICT (name) DO NOTHING;
-                """)
-        )
-    if dialect_name == "mysql":
-        op.execute(
-            text("""
-                    INSERT IGNORE INTO dag_bundle (name) VALUES
-                      ('example_dags'),
-                      ('dags-folder');
-                    """)
-        )
-    if dialect_name == "sqlite":
-        op.execute(
-            text("""
-                    INSERT OR IGNORE INTO dag_bundle (name) VALUES
-                      ('example_dags'),
-                      ('dags-folder');
+    with disable_sqlite_fkeys(op):

Review Comment:
   So this change is just to disable sqlite fkeys, I don't think we have to put 
the context manager over other dbs. Maybe in this particular case we shouldn't 
use `with disable_sqlite_fkeys` but use `conn.execute(sa.text("PRAGMA 
foreign_keys=off"))` after the` if dialect_name == "sqlite"` line



-- 
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]

Reply via email to