Skip to content

Add work items related link restrictions table

Related to #424880 (closed)

What does this MR do and why?

Adds a new table called work_item_related_link_restrictions to the database. This table will store restrictions on what types of work items can be linked to each other.

Because the restriction can differ depending on the type of link this table includes the column link_type which is an enum attribute matching link_type in IssuableLink.

This table's functionality is similar to work_item_hierarchy_restrictions (added in !103796 (merged)) and will need a follow-up migration to add the records and the model validation in WorkItems::RelatedWorkItemLink (see #424880 (closed)).

Database

# UP
 bin/rails db:migrate:up:main VERSION=20230930094139
main: == [advisory_lock_connection] object_id: 226880, pg_backend_pid: 88055
main: == 20230930094139 AddRelatedLinkRestrictions: migrating =======================
main: -- create_table(:work_item_related_link_restrictions)
main:    -> 0.0073s
main: == 20230930094139 AddRelatedLinkRestrictions: migrated (0.1162s) ==============

# DOWN
 bin/rails db:migrate:down:main VERSION=20230930094139
main: == [advisory_lock_connection] object_id: 263280, pg_backend_pid: 87145
main: == 20230930094139 AddRelatedLinkRestrictions: reverting =======================
main: -- drop_table(:work_item_related_link_restrictions)
main:    -> 0.0019s
main: == 20230930094139 AddRelatedLinkRestrictions: reverted (0.0054s) ==============

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eugenia Grieff

Merge request reports

Loading