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


##########
airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py:
##########
@@ -48,12 +49,32 @@ def upgrade():
         sa.Column("last_refreshed", UtcDateTime(timezone=True), nullable=True),
         sa.PrimaryKeyConstraint("name", name=op.f("dag_bundle_pkey")),
     )
+
     with op.batch_alter_table("dag", schema=None) as batch_op:
         batch_op.add_column(sa.Column("bundle_name", sa.String(length=250), 
nullable=True))
         batch_op.add_column(sa.Column("bundle_version", sa.String(length=200), 
nullable=True))
+
         batch_op.create_foreign_key(
             batch_op.f("dag_bundle_name_fkey"), "dag_bundle", ["bundle_name"], 
["name"]
         )
+
+        conn = op.get_bind()
+        conn.execute(
+            text(
+                """
+                UPDATE dag
+                SET bundle_name =
+                    CASE
+                        WHEN fileloc LIKE '%/airflow/airflow/example_dags/%' 
THEN 'example_dags'
+                        ELSE 'dags-folder'

Review Comment:
   @jedcunningham what do you think of this? I guess any string would work here 
instead of having the case statement. Dag processor will later update the dag 
on the next run. 



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