Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(db): ensure query_context is MediumText before viz migration #20936

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Aug 1, 2022

SUMMARY

Since #20779 will just be an no-op if the columns are already MediumText, let's just do it again before the viz migration. This way, administrators don't have to remember to manually migrate the columns before running superset db migration.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

CI and tested locally via superset db upgrade.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@ktmud ktmud requested a review from a team as a code owner August 1, 2022 16:47
@ktmud ktmud force-pushed the ensure-query-context-medium-text branch from 64c0ea7 to 7ffd95a Compare August 1, 2022 16:58
# 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktmud why raw SQL here and not the Alembic alter_column method?

Copy link
Member Author

@ktmud ktmud Aug 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is only for one dialect and raw SQL is easier to read. People can also copy the statement directly if they ever want to test it manually.

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ktmud ktmud merged commit 2c8867e into apache:master Aug 8, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants