20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb 446 Bytes
Newer Older
1
# rubocop:disable RemoveIndex
2
class AddIndexToCiBuildsForStatusRunnerIdAndType < ActiveRecord::Migration[4.2]
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_builds, [:status, :type, :runner_id]
  end

  def down
    if index_exists?(:ci_builds, [:status, :type, :runner_id])
      remove_index :ci_builds, column: [:status, :type, :runner_id]
    end
  end
end