Update name validation and index on ApprovalMergeRequestRule
(Broken out from #12137 (comment 327671181))
We’ll need to update the unique index, which is currently:
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);
(Add in db/migrate/20190402150158_backport_enterprise_schema.rb
)
We also want to update
index_approval_rule_name_for_code_owners_rule_type
We’ll additionally need to update the name
validation/unique index to add the scope of :section
# ee/app/models/approval_merge_request_rule.rb:29
#
validates :name, uniqueness: { scope: [:merge_request_id, :rule_type] }`
Supports #12137 (closed)