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

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

class ReplaceIndexOnMetricsMergedAt < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :merge_request_metrics, :merged_at
    remove_concurrent_index :merge_request_metrics, [:merged_at, :id]
  end

  def down
    add_concurrent_index :merge_request_metrics, [:merged_at, :id]
    remove_concurrent_index :merge_request_metrics, :merged_at
  end
end