Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20220929101947_delete_remove_invalid_member_migration.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6fb358e57ab10870f80b54183c454e8195eeccc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class DeleteRemoveInvalidMemberMigration < Gitlab::Database::Migration[2.0]
  PROJECT_MEMBER_MIGRATION = 'ScheduleDestroyInvalidProjectMembers'
  GROUP_MEMBER_MIGRATION = 'ScheduleDestroyInvalidGroupMembers'

  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  def up
    delete_batched_background_migration(PROJECT_MEMBER_MIGRATION, :members, :id, [])
    delete_batched_background_migration(GROUP_MEMBER_MIGRATION, :members, :id, [])
  end

  def down
    # no-op
  end
end