2017-02-10 10:41:22 +00:00
|
|
|
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
|
|
|
|
# for more information on how to write migrations for GitLab.
|
|
|
|
|
2017-04-05 22:53:57 +00:00
|
|
|
# rubocop:disable RemoveIndex
|
2017-02-10 10:41:22 +00:00
|
|
|
class AddIndexToUserAgentDetail < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-03-07 16:08:53 +00:00
|
|
|
def up
|
|
|
|
add_concurrent_index :user_agent_details, [:subject_id, :subject_type]
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_index :user_agent_details, [:subject_id, :subject_type] if index_exists? :user_agent_details, [:subject_id, :subject_type]
|
2017-02-10 10:41:22 +00:00
|
|
|
end
|
|
|
|
end
|