summaryrefslogtreecommitdiff
path: root/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb')
-rw-r--r--db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
new file mode 100644
index 00000000000..2cef570966b
--- /dev/null
+++ b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddCiRunnersIndexOnActiveState < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_runners_on_active'
+
+ def up
+ add_concurrent_index :ci_runners, [:active, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :ci_runners, INDEX_NAME
+ end
+end