2019-02-15 15:39:39 +05:30
|
|
|
class AddIndexesToRemoteMirror < ActiveRecord::Migration[4.2]
|
2018-10-15 14:42:47 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_concurrent_index :remote_mirrors, :last_successful_update_at unless index_exists?(:remote_mirrors, :last_successful_update_at)
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2019-09-04 21:01:54 +05:30
|
|
|
# ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb will remove the index.
|
2018-11-18 11:00:15 +05:30
|
|
|
# rubocop:disable Migration/RemoveIndex
|
2018-10-15 14:42:47 +05:30
|
|
|
remove_index :remote_mirrors, :last_successful_update_at if index_exists? :remote_mirrors, :last_successful_update_at
|
|
|
|
end
|
|
|
|
end
|