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

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

class AddAuditorIndexToUsersTable < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_users_for_auditors'
  disable_ddl_transaction!

  def up
    # rubocop:disable Migration/PreventIndexCreation
    add_concurrent_index :users, :id, where: 'auditor IS true', name: INDEX_NAME
    # rubocop:enable Migration/PreventIndexCreation
  end

  def down
    remove_concurrent_index_by_name :users, name: INDEX_NAME
  end
end