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

fix: Downgrade of revision 678eefb4ab44 throws error #29799

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Fixes the following error when downgrading revision 678eefb4ab44:

sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) 
(1553, "Cannot drop index 'idx_user_id_database_id': needed in a foreign key constraint")

Fixes #29789

TESTING INSTRUCTIONS

Make sure you can downgrade the revision.

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

@michael-s-molina michael-s-molina requested a review from a team as a code owner July 31, 2024 17:00
@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Jul 31, 2024
@michael-s-molina michael-s-molina removed the risk:db-migration PRs that require a DB migration label Jul 31, 2024
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.70%. Comparing base (76d897e) to head (2553857).
Report is 1094 commits behind head on master.

Files with missing lines Patch % Lines
superset/migrations/shared/constraints.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29799       +/-   ##
===========================================
+ Coverage   60.48%   83.70%   +23.21%     
===========================================
  Files        1931      527     -1404     
  Lines       76236    38012    -38224     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31819    -14295     
+ Misses      28017     6193    -21824     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 49.04% <0.00%> (-0.12%) ⬇️
javascript ?
mysql 76.82% <0.00%> (?)
postgres 76.89% <0.00%> (?)
presto 53.59% <0.00%> (-0.21%) ⬇️
python 83.70% <0.00%> (+20.21%) ⬆️
sqlite 76.38% <0.00%> (?)
unit 59.95% <0.00%> (+2.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM - though it could be nice to implement as a reusable function def drop_fks_for_table(table_name) in superset/migrations/shared/constraints.py

@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Jul 31, 2024
@michael-s-molina
Copy link
Member Author

LGTM - though it could be nice to implement as a reusable function def drop_fks_for_table(table_name) in superset/migrations/shared/constraints.py

Good point. Done 👍🏼

@michael-s-molina michael-s-molina removed the risk:db-migration PRs that require a DB migration label Jul 31, 2024
@michael-s-molina michael-s-molina merged commit 249f5ec into apache:master Aug 1, 2024
39 checks passed
@sadpandajoe
Copy link
Member

@supersetbot label 4.1

@github-actions github-actions bot added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Aug 1, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Aug 1, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Aug 1, 2024
sadpandajoe pushed a commit that referenced this pull request Aug 13, 2024
@github-actions github-actions bot added 🍒 4.1.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Nov 14, 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 v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch 🍒 4.1.0 🍒 4.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revision 678eefb4ab44 throws an error when downgrading
3 participants