amoghrajesh commented on code in PR #61976:
URL: https://github.com/apache/airflow/pull/61976#discussion_r2831576200


##########
airflow-core/src/airflow/migrations/versions/0060_3_0_0_add_try_id_to_ti_and_tih.py:
##########
@@ -158,3 +169,7 @@ def downgrade():
         batch_op.alter_column("id", nullable=False, existing_type=sa.INTEGER)
         batch_op.drop_column("try_id")
         batch_op.create_primary_key("task_instance_history_pkey", ["id"])
+
+    if dialect_name == "mysql":
+        # Restore AUTO_INCREMENT
+        op.execute("ALTER TABLE task_instance_history MODIFY COLUMN id INTEGER 
NOT NULL AUTO_INCREMENT")

Review Comment:
   Adding `AUTO_INCREMENT` to existing column is treated as a column type 
change as I remember reading in: 
https://stackoverflow.com/questions/47403383/why-does-modify-auto-increment-need-to-rebuild-the-table
   
   Which would theoretically require 2x table size to be free during the 
operation. So I wanted to mention it out here, I do not know of a better option 
though / even if its possible 



-- 
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