diff options
Diffstat (limited to 'db/migrate/20221226132038_index_ci_runners_on_creator_id.rb')
-rw-r--r-- | db/migrate/20221226132038_index_ci_runners_on_creator_id.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb b/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb new file mode 100644 index 00000000000..e163380533b --- /dev/null +++ b/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexCiRunnersOnCreatorId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runners_on_creator_id_where_creator_id_not_null' + + def up + add_concurrent_index :ci_runners, :creator_id, where: 'creator_id IS NOT NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end |