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

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

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

  INDEX_NAME = 'index_on_issues_health_status_desc_order'

  def up
    remove_concurrent_index_by_name :issues, name: INDEX_NAME
  end

  def down
    add_concurrent_index :issues,
      [:project_id, :health_status, :id, :state_id, :issue_type],
      order: { health_status: 'DESC NULLS LAST', id: :desc },
      name: INDEX_NAME
  end
end