Skip to content

Cleanup invalid membership invites

What does this MR do?

Cleanups invalid invites. How it happens: https://gitlab.com/gitlab-org/gitlab/-/issues/247910#note_646505348

Migration details

== 20210809123658 OrphanedInviteTokensCleanup: reverting ======================
-- indexes("members")
   -> 0.0208s
-- current_schema()
   -> 0.0014s
== 20210809123658 OrphanedInviteTokensCleanup: reverted (0.0265s) =============

== 20210809123658 OrphanedInviteTokensCleanup: migrating ======================
-- transaction_open?()
   -> 0.0000s
-- index_exists?("members", :id, {:where=>"invite_token IS NOT NULL and invite_accepted_at IS NOT NULL and invite_accepted_at < created_at", :name=>"tmp_idx_orphaned_invite_tokens", :algorithm=>:concurrently})
   -> 0.0304s
-- add_index("members", :id, {:where=>"invite_token IS NOT NULL and invite_accepted_at IS NOT NULL and invite_accepted_at < created_at", :name=>"tmp_idx_orphaned_invite_tokens", :algorithm=>:concurrently})
   -> 0.0074s
-- transaction_open?()
   -> 0.0000s
-- indexes("members")
   -> 0.0280s
-- remove_index("members", {:algorithm=>:concurrently, :name=>"tmp_idx_orphaned_invite_tokens"})
   -> 0.0039s
== 20210809123658 OrphanedInviteTokensCleanup: migrated (0.0873s) =============

Roughly 6000 rows affected

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #247910

Edited by Mayra Cabrera

Merge request reports