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

20201208143911_add_approvals_created_at_index.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cfec6b257c2c042546ac622b7f9a9adc0ac51178 (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 AddApprovalsCreatedAtIndex < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  INDEX_NAME = 'index_approvals_on_merge_request_id_and_created_at'

  def up
    add_concurrent_index :approvals, [:merge_request_id, :created_at], name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :approvals, INDEX_NAME
  end
end