ephraimbuddy commented on code in PR #54242:
URL: https://github.com/apache/airflow/pull/54242#discussion_r2342337019
##########
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:
What I mean is, during the upgrade, say there's 20 taskinstances in the
backup. If after upgrade, user ran a lot more tasks that now have TI history.
If they want to downgrade to a lower version, then, the task_instance_id_backup
is holding just 20 TI IDs, what will happen for the other TI histories that
were created after the backup? Say 2 of them. What value would be in the
task_instance_id column?
--
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]