2017-04-05 18:53:57 -04:00
|
|
|
# rubocop:disable RemoveIndex
|
2018-11-13 02:27:31 -05:00
|
|
|
class MergeRequestDiffAddIndex < ActiveRecord::Migration[4.2]
|
2016-07-25 07:09:23 -04:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
# Set this constant to true if this migration requires downtime.
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_concurrent_index :merge_request_diffs, :merge_request_id
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
if index_exists?(:merge_request_diffs, :merge_request_id)
|
|
|
|
remove_index :merge_request_diffs, :merge_request_id
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|