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

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

class AddIndexIssuesOnProjectHealthStatusAscWorkItemType < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_issues_on_project_health_status_asc_work_item_type'

  disable_ddl_transaction!

  def up
    add_concurrent_index :issues,
      [:project_id, :health_status, :id, :state_id, :work_item_type_id],
      order: { health_status: 'ASC NULLS LAST', id: :desc },
      name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :issues, INDEX_NAME
  end
end