Add DestroyInvalidMembers migration
What does this MR do and why?
Describe in detail what your merge request does and why.
Issue: #375297 (closed)
We have some invalid membership records that may have been the result of an old console/SQL delete. The namespace IDs don't point to existing records. This MR removes them.
- Add a temp index on null member namespace id so we can use it later: !99212 (merged)
✅ - Delete the migration that used the less performant column: !99231 (merged)
- Create new migration using the more performant column and index with a later timestamp !99467 (merged) (this MR)
- Finalize migration !99080 (merged)
- Drop the temp index
% rails db:migrate
main: == 20220930062114 ScheduleDestroyInvalidMembers: migrating ====================
main: == 20220930062114 ScheduleDestroyInvalidMembers: migrated (0.0540s) ===========
main: == 20220930062114 ScheduleDestroyInvalidMembers: reverting ====================
main: == 20220930062114 ScheduleDestroyInvalidMembers: reverted (0.0678s) ===========
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Serena Fang