2016-09-13 17:45:13 +05:30
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
# rubocop:disable RemoveIndex
|
2018-12-23 12:14:25 +05:30
|
|
|
class AddIndexToNoteDiscussionId < ActiveRecord::Migration[4.2]
|
2016-09-13 17:45:13 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def up
|
2016-09-13 17:45:13 +05:30
|
|
|
add_concurrent_index :notes, :discussion_id
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
def down
|
|
|
|
remove_index :notes, :discussion_id if index_exists? :notes, :discussion_id
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|