gitlab-org--gitlab-foss/db/migrate/20170204181513_add_index_to...

17 lines
376 B
Ruby

# rubocop:disable RemoveIndex
class AddIndexToLabelsForTypeAndProject < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :labels, [:type, :project_id]
end
def down
remove_index :labels, [:type, :project_id] if index_exists? :labels, [:type, :project_id]
end
end