summaryrefslogtreecommitdiff
path: root/db/migrate/20200331113728_add_index_to_ci_ref_id.rb
blob: d3495fd4fa1ceec589dbe32a38e82e6c8c6073ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

class AddIndexToCiRefId < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_pipelines, [:ci_ref_id], where: 'ci_ref_id IS NOT NULL'
  end

  def down
    remove_concurrent_index :ci_pipelines, [:ci_ref_id], where: 'ci_ref_id IS NOT NULL'
  end
end