summaryrefslogtreecommitdiff
path: root/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb
blob: fbe5fe31ae8957f0680e24e1758e9295bc927a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class AddIndexOnCiBuildsProtected < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_builds, :protected
  end

  def down
    remove_concurrent_index :ci_builds, :protected if index_exists?(:ci_builds, :protected)
  end
end