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

🔨 Make more db relationships cascade on delete for charts #3828

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

larsyencken
Copy link
Contributor

Previously, if you tried to delete a chart in the DB, it would fail if there were any linked rows in suggested_chart_revisions (some charts) or chart_dimensions (all charts).

With this migration, both of those relationships cascade on delete, meaning that deleting a chart will succeed even if there are associated chart dimension rows and suggested revisions. However, other relationships, such as usage in explorers, will still prevent deletion.

Previously, if you tried to delete a chart in the DB, it would fail if
there were any linked rows in `suggested_chart_revisions` (some charts)
or `chart_dimensions` (all charts).

With this migration, both of those relationships cascade on delete,
meaning that deleting a chart will succeed even if there are associated
chart dimension rows and suggested revisions. However, other
relationships, such as usage in explorers, will still prevent deletion.
@larsyencken
Copy link
Contributor Author

This has been QA'd basically by checking that the migrations succeed in local dev, and attempting to delete some charts from local dev, and checking that deletes do cascade for these relationships.

@larsyencken larsyencken requested a review from danyx23 July 31, 2024 09:59
@owidbot
Copy link
Contributor

owidbot commented Jul 31, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-suggested-revisions-migration

SVG tester:

Number of differences (default views): 2 (dac81a) ❌
Number of differences (all views): 0 ✅

Edited: 2024-07-31 15:32:14 UTC
Execution time: 1.19 seconds

Copy link
Contributor

@danyx23 danyx23 left a comment

Choose a reason for hiding this comment

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

Nice!

@larsyencken larsyencken merged commit 008db39 into master Aug 1, 2024
20 checks passed
@larsyencken larsyencken deleted the suggested-revisions-migration branch August 1, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants