diff options
Diffstat (limited to 'db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb')
-rw-r--r-- | db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb b/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb new file mode 100644 index 00000000000..140bf7df4e6 --- /dev/null +++ b/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToProtectedPendingBuilds < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + INDEX_NAME = 'index_ci_pending_builds_id_on_protected_partial' + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pending_builds, :id, where: 'protected = true', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_pending_builds, INDEX_NAME + end +end |