Skip to content

Add 'section' to approval_merge_request_rules

What does this MR do?

Adds a column 'section' to approval_merge_request_rules table to support #12137 (closed). When new approval rules are created from the parsed CODEOWNERS file, we want to record their corresponding section (when available) for sorting and display on the front-end.

== 20200513224143 AddSectionToApprovalMergeRequestRule: migrating =============
-- add_column(:approval_merge_request_rules, :section, :text)
   -> 0.0019s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE approval_merge_request_rules\nADD CONSTRAINT check_6fca5928b2\nCHECK ( char_length(section) <= 255 )\nNOT VALID;\n")
   -> 0.0007s
-- execute("ALTER TABLE approval_merge_request_rules VALIDATE CONSTRAINT check_6fca5928b2;")
   -> 0.0004s
== 20200513224143 AddSectionToApprovalMergeRequestRule: migrated (0.0113s) ====

Rollback:

== 20200513224143 AddSectionToApprovalMergeRequestRule: reverting =============
-- remove_column(:approval_merge_request_rules, :section)
   -> 0.0043s
== 20200513224143 AddSectionToApprovalMergeRequestRule: reverted (0.0044s) ====

Rollback procedure: This is a non-destructive migration, and should be able to freely rolled back. Loosing section data will impact display, but not function of any impacted approval rules.

Closes #215193 (closed)

Edited by Kerri Miller

Merge request reports

Loading