diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-01-21 16:08:27 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-01-21 16:08:27 +0300 |
commit | 86881f4f7901b7cc31c730c7fff378a6a073eff8 (patch) | |
tree | b172a03e65b2635db26e881665c568a74bf3df4d /db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb | |
parent | e447ea63a49b1f28975fc9678fe92a679a34455b (diff) |
Add index for ci_runners if they are shared
Diffstat (limited to 'db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb')
-rw-r--r-- | db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb b/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb new file mode 100644 index 00000000000..620befcf4d7 --- /dev/null +++ b/db/migrate/20170121130655_add_index_to_ci_runners_for_is_shared.rb @@ -0,0 +1,17 @@ +class AddIndexToCiRunnersForIsShared < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_runners, :is_shared + end + + def down + if index_exists?(:ci_runners, :is_shared) + remove_index :ci_runners, :is_shared + end + end +end |