You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/02 21:57:18 UTC

[GitHub] [superset] john-bodley commented on a diff in pull request #20936: chore(db): ensure query_context is MediumText before viz migration

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org