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

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

class AddIndexOnMergeRequestsTargetProjectIdAndMergedCommitSha < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_merge_requests_on_target_project_id_and_merged_commit_sha'
  INDEX_COLUMNS = %i[target_project_id merged_commit_sha]

  disable_ddl_transaction!

  def up
    add_concurrent_index :merge_requests, INDEX_COLUMNS, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :merge_requests, name: INDEX_NAME
  end
end