2017-04-05 22:53:57 +00:00
|
|
|
# rubocop:disable RemoveIndex
|
2017-01-30 20:50:47 +00:00
|
|
|
class AddIndexToProjectAuthorizations < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2017-04-05 14:59:28 +00:00
|
|
|
unless index_exists?(:project_authorizations, :project_id)
|
|
|
|
add_concurrent_index(:project_authorizations, :project_id)
|
|
|
|
end
|
2017-01-30 20:50:47 +00:00
|
|
|
end
|
2017-03-14 06:36:33 +00:00
|
|
|
|
|
|
|
def down
|
2017-03-14 12:03:22 +00:00
|
|
|
remove_index(:project_authorizations, :project_id) if
|
|
|
|
Gitlab::Database.postgresql?
|
2017-03-14 06:36:33 +00:00
|
|
|
end
|
2017-01-30 20:50:47 +00:00
|
|
|
end
|