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

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

class DropIndexOnIssuesClosedIncidentsByProjectIdAndClosedAt < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  INDEX_NAME = 'index_on_issues_closed_incidents_by_project_id_and_closed_at'

  def up
    remove_concurrent_index_by_name :issues, name: INDEX_NAME
  end

  def down
    add_concurrent_index :issues, [:project_id, :closed_at], where: 'issue_type = 1 AND state_id = 2', name: INDEX_NAME
  end
end