debian-mirror-gitlab/db/migrate/20160725104452_merge_request_diff_add_index.rb

19 lines
483 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
# rubocop:disable RemoveIndex
2018-12-23 12:14:25 +05:30
class MergeRequestDiffAddIndex < ActiveRecord::Migration[4.2]
2016-09-29 09:46:39 +05:30
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