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

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

class AddIssueTypeIndexToIssues < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  disable_ddl_transaction!

  INCIDENT_TYPE = 1
  INDEX_NAME    = 'index_issues_on_incident_issue_type'

  def up
    add_concurrent_index :issues,
                         :issue_type, where: "issue_type = #{INCIDENT_TYPE}",
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index :issues, :issue_type
  end
end