gitlab-org--gitlab-foss/db/migrate/20170619144837_add_index_fo...

16 lines
380 B
Ruby
Raw Normal View History

class AddIndexForHeadPipelineMergeRequest < ActiveRecord::Migration[4.2]
2017-06-19 14:52:57 +00:00
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :merge_requests, :head_pipeline_id
end
def down
remove_concurrent_index :merge_requests, :head_pipeline_id if index_exists?(:merge_requests, :head_pipeline_id)
end
end