ephraimbuddy commented on code in PR #54242:
URL: https://github.com/apache/airflow/pull/54242#discussion_r2313165553
##########
airflow-core/src/airflow/migrations/versions/0068_3_0_0_ti_table_id_unique_per_try.py:
##########
@@ -113,9 +122,13 @@ def downgrade():
existing_nullable=False,
)
batch_op.drop_index("idx_tih_dag_run")
+
# This has to be in a separate batch, else on sqlite it throws
`sqlalchemy.exc.CircularDependencyError`
# (and on non sqlite batching isn't "a thing", it issue alter tables fine)
with op.batch_alter_table("task_instance_history", schema=None) as
batch_op:
- batch_op.add_column(
- sa.Column("task_instance_id", UUIDType(binary=False),
autoincrement=False, nullable=True)
+ batch_op.alter_column(
+ "task_instance_id_backup",
+ new_column_name="task_instance_id",
+ existing_type=_get_uuid_type(dialect_name),
+ existing_nullable=False,
Review Comment:
How about new TIs created after you did the backup? task_instance_id for
those columns on TI history would be null
--
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]