BigW Consortium Gitlab

20170816153940_add_index_on_ci_builds_protected.rb 331 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class AddIndexOnCiBuildsProtected < ActiveRecord::Migration
  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