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

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

class AddIndexForOpenIssuesCount < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  INDEX_NAME = 'idx_open_issues_on_project_id_and_confidential'

  def up
    add_concurrent_index :issues, [:project_id, :confidential], where: 'state_id = 1', name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :issues, INDEX_NAME
  end
end