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

Delete unused objects #7823

Merged
merged 9 commits into from
Oct 30, 2024
Merged

Delete unused objects #7823

merged 9 commits into from
Oct 30, 2024

Conversation

FelixMalfait
Copy link
Member

Fixes #7113

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

Great @FelixMalfait ! I think sync-metadata won't work there because we are removing multiple objects that depend on each others and we don't have a clear control on the order of deletion.
Also we might need a command for people that created custom relations between their objects and those deleted tables 🤔. We could do like we do with deprecated fields and instead of deleting those objects (and tables), we convert them to custom objects, that would be the "easy" solution but definitely not the best there I think
Edit: we could also update the sync-metatadata logic so it properly removes the foreign key constraints before deleting objects

@Weiko Weiko marked this pull request as ready for review October 29, 2024 17:37
@Weiko
Copy link
Member

Weiko commented Oct 29, 2024

I've updated your PR.

  • Object deletion migration now contains DROP_FOREIGN_KEY mutations for relations, this will allow us to delete objects which are dependencies from other tables
  • Field metadata deletion mutations now delete the associated indexes, this is because IndexFieldMetadata are already deleted from CASCADE rule but because our indexes always have deletedAt as default column, the parent IndexMetadata remains and breaks the sync because it does not match the standard definition

@Weiko Weiko merged commit 50c912d into main Oct 30, 2024
17 of 22 checks passed
@Weiko Weiko deleted the fix-7113 branch October 30, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Activity object
2 participants