Skip to content

Add trigger to update issues correct_work_item_type_id

Mario Celi requested to merge 493974-reintroduce-fk into master

What does this MR do and why?

Before we introduced a trigger on insert or update but we didn't account for updates of issues records that don't change the work_item_type_id column. This new trigger should be executed for every update and set the correct value only if it wasn't updated before.

With this trigger, it should be safe to add a NOT VALID FK on issues.correct_work_item_type_id. This is a second attempt to add the FK as before it caused an incident when updating issue records gitlab-com/gl-infra/production#18692 (closed)

Timeline of migrations

MR acceptance checklist.

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #493974 (closed)

Edited by Mario Celi

Merge request reports

Loading