Commit b713d921 authored by Kerri Miller's avatar Kerri Miller Committed by Toon Claes

Add index of merge_request_id and rule_type

Adds an index on these 2 columns ahead of removing a similar index on
merge_request_id and code_owner, as the code_owner column is slated for
removal
parent 1f149dde
---
title: Add index on merge_request_id to approval_merge_request_rules
merge_request: 40556
author:
type: other
# frozen_string_literal: true
class AddIndexOnMergeRequestIdAndRuleTypeToApprovalMergeRequestRule < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
INDEX_NAME = "approval_mr_rule_index_merge_request_id"
def up
add_concurrent_index(
:approval_merge_request_rules,
:merge_request_id,
name: INDEX_NAME
)
end
def down
remove_concurrent_index_by_name :approval_merge_request_rules, INDEX_NAME
end
end
360c42f4d34c3b03e7a0375a0ff2776f066888f0a40131180bf301b876ea58db
\ No newline at end of file
......@@ -18922,6 +18922,8 @@ CREATE UNIQUE INDEX any_approver_merge_request_rule_type_unique_index ON public.
CREATE UNIQUE INDEX any_approver_project_rule_type_unique_index ON public.approval_project_rules USING btree (project_id) WHERE (rule_type = 3);
CREATE INDEX approval_mr_rule_index_merge_request_id ON public.approval_merge_request_rules USING btree (merge_request_id);
CREATE UNIQUE INDEX approval_rule_name_index_for_code_owners ON public.approval_merge_request_rules USING btree (merge_request_id, code_owner, name) WHERE ((code_owner = true) AND (section IS NULL));
CREATE UNIQUE INDEX backup_labels_group_id_project_id_title_idx ON public.backup_labels USING btree (group_id, project_id, title);
......
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