diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-03 17:19:21 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-05-07 13:00:13 +0300 |
commit | 961255b107370a1350f91d0835cf0e849d237f7d (patch) | |
tree | 74690c9c0df07f86a6acccc5b7ebc51d310fefa2 /db/migrate/20180503193542_add_indexes_to_remote_mirror.rb | |
parent | 9a13059332a0c81b3a953f57bb9e40346eba951d (diff) |
Adds remote mirror table migration
Diffstat (limited to 'db/migrate/20180503193542_add_indexes_to_remote_mirror.rb')
-rw-r--r-- | db/migrate/20180503193542_add_indexes_to_remote_mirror.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb new file mode 100644 index 00000000000..9a9decffdab --- /dev/null +++ b/db/migrate/20180503193542_add_indexes_to_remote_mirror.rb @@ -0,0 +1,15 @@ +class AddIndexesToRemoteMirror < ActiveRecord::Migration + 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 + remove_index :remote_mirrors, :last_successful_update_at if index_exists? :remote_mirrors, :last_successful_update_at + end +end |