john-bodley commented on code in PR #20936:
URL: https://github.com/apache/superset/pull/20936#discussion_r936059564


##########
superset/migrations/versions/2022-07-07_13-00_c747c78868b6_migrating_legacy_treemap.py:
##########
@@ -29,6 +32,14 @@
 
 
 def upgrade():
+    # Ensure `slice.params` and `slice.query_context`` in MySQL is MEDIUMTEXT
+    # before migration, as the migration will save a duplicate form_data backup
+    # which may significantly increase the size of these fields.
+    if isinstance(op.get_bind().dialect, MySQLDialect):
+        # If the columns are already MEDIUMTEXT, this is a no-op
+        op.execute("ALTER TABLE slices MODIFY params MEDIUMTEXT")

Review Comment:
   @ktmud why raw SQL here and not the Alembic 
[alter_column](https://alembic.sqlalchemy.org/en/latest/ops.html#alembic.operations.Operations.alter_column)
 method?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to