ashb commented on code in PR #74409:
URL: https://github.com/apache/airflow/pull/74409#discussion_r4211988630


##########
airflow-core/src/airflow/migrations/versions/0136_3_4_0_fold_task_map_into_xcom_mapped_length.py:
##########
@@ -116,9 +116,16 @@ def build_restore_statement(xcom_name: str = "xcom", 
task_map_name: str = "task_
 def upgrade():
     """Fold task_map into xcom.mapped_length."""
     with disable_sqlite_fkeys(op):
+        dialect = op.get_bind().dialect.name
         with op.batch_alter_table("xcom", schema=None) as batch_op:
             batch_op.add_column(sa.Column("mapped_length", sa.Integer(), 
nullable=True))
-            batch_op.create_check_constraint("mapped_length_not_negative", 
"mapped_length >= 0")
+            # MySQL can only add a CHECK by copying the whole table 
(ALGORITHM=COPY).
+            if dialect != "mysql":

Review Comment:
   You make an execelent case, it's just not worth it at all.



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