Skip to content

Add DestroyInvalidMembers migration

Serena Fang requested to merge remove-invalid-members-migration into master

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.

  1. Add a temp index on null member namespace id so we can use it later: !99212 (merged)
  2. Delete the migration that used the less performant column: !99231 (merged)
  3. Create new migration using the more performant column and index with a later timestamp !99467 (merged) (this MR)
  4. Finalize migration !99080 (merged)
  5. 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.

Edited by Serena Fang

Merge request reports

Loading