debian-mirror-gitlab/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
442 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
class PrepareIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id'
def up
prepare_async_index :ci_builds, [:resource_group_id, :status, :commit_id],
where: 'resource_group_id IS NOT NULL',
name: INDEX_NAME
end
def down
unprepare_async_index_by_name :ci_builds, INDEX_NAME
end
end