ephraimbuddy commented on code in PR #47592:
URL: https://github.com/apache/airflow/pull/47592#discussion_r1988752717
##########
airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py:
##########
@@ -48,12 +49,30 @@ 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_name", sa.String(length=250),
nullable=False))
batch_op.add_column(sa.Column("bundle_version", sa.String(length=200),
nullable=True))
+
+ 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'
+ END
+ WHERE bundle_name IS NULL
+ """
+ )
+ )
Review Comment:
```suggestion
```
Let's remove the data migration since this has not been released
--
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]