2018-01-12 20:38:36 +00:00
|
|
|
# rubocop:disable RemoveIndex
|
|
|
|
|
2018-11-13 07:27:31 +00:00
|
|
|
class AddIndexOnMergeRequestDiffCommitSha < ActiveRecord::Migration[4.2]
|
2018-01-12 20:38:36 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2018-09-21 10:23:29 +00:00
|
|
|
add_concurrent_index :merge_request_diff_commits, :sha, length: mysql_compatible_index_length
|
2018-01-12 20:38:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_index :merge_request_diff_commits, :sha if index_exists? :merge_request_diff_commits, :sha
|
|
|
|
end
|
|
|
|
end
|