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

20230714095946_schedule_unique_index_project_authorizations_on_unique_project_user.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d4d51131dda319725b6a9f8978d5a9cd146b1a4d (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 ScheduleUniqueIndexProjectAuthorizationsOnUniqueProjectUser < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_unique_project_authorizations_on_unique_project_user'

  def up
    prepare_async_index :project_authorizations,
      %i[project_id user_id],
      unique: true,
      where: "is_unique",
      name: INDEX_NAME
  end

  def down
    unprepare_async_index :project_authorizations,
      %i[project_id user_id],
      name: INDEX_NAME
  end
end