Commit aa8ee780 authored by Bala Kumar's avatar Bala Kumar Committed by Adam Hegyi

Add index for selecting resource_group from ci_builds

Changelog: performance
parent 4c04855e
# 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
cc8f1bea8c722dfa06fc23a3dbaaacd7f1b7c5f7b529ebfab34b7c7c38e5db79
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment