diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-07 20:06:13 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-07 20:06:13 +0000 |
commit | e714d569f388bea4636e8e454a28ded502f080d1 (patch) | |
tree | e55dd77491d825f170e23302f5b901bb6947ca33 /db/migrate/20160620115026_add_index_on_runners_locked.rb | |
parent | 51cddc9639a4eec4d6ac58753400353f44e9494d (diff) | |
parent | e3ddd871027e2e9f4ceef658a5ba646d5ade7045 (diff) | |
download | gitlab-ce-e714d569f388bea4636e8e454a28ded502f080d1.tar.gz |
Merge branch 'dm-add-concurrent-index-cop' into 'master'
Add cop to ensure reversibility of add_concurrent_index
See merge request !9771
Diffstat (limited to 'db/migrate/20160620115026_add_index_on_runners_locked.rb')
-rw-r--r-- | db/migrate/20160620115026_add_index_on_runners_locked.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/db/migrate/20160620115026_add_index_on_runners_locked.rb b/db/migrate/20160620115026_add_index_on_runners_locked.rb index dfa5110dea4..6ca486c63d1 100644 --- a/db/migrate/20160620115026_add_index_on_runners_locked.rb +++ b/db/migrate/20160620115026_add_index_on_runners_locked.rb @@ -4,9 +4,15 @@ class AddIndexOnRunnersLocked < ActiveRecord::Migration include Gitlab::Database::MigrationHelpers + DOWNTIME = false + disable_ddl_transaction! - def change + def up add_concurrent_index :ci_runners, :locked end + + def down + remove_index :ci_runners, :locked if index_exists? :ci_runners, :locked + end end |