MASTREX commented on code in PR #54242:
URL: https://github.com/apache/airflow/pull/54242#discussion_r2349677692


##########
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:
   > Yes you are right, there will be no values and it will fail whenever a new 
row is added
   
   This will take effect just after upgrade, so with no null values allowed we 
get error whenever we are adding new row to `task_instance_history`. To handle 
this I will turn the backup column to 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]

Reply via email to