ephraimbuddy commented on code in PR #47592:
URL: https://github.com/apache/airflow/pull/47592#discussion_r1990749567
##########
airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py:
##########
@@ -48,12 +49,16 @@ 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))
Review Comment:
Oh, my bad, this is tricky, then. Should it be populated with `dags-folder`
or `example-dags` or just any string? What if the old dag is from a git repo. I
think best to update with dummy string and have the dag processor update it in
the next cycle.
@gyli , basically, you have to first set this column as nullable, then run
the update query and alter the column to make it non-nullable
--
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]