Skip to content

Drop issues.correct_work_item_type_id foreign key

Heinrich Lee Yu requested to merge hly-revert-foreign-key into master

What does this MR do and why?

This is causing errors in production: gitlab-com/gl-infra/production#18692 (closed) so we drop this temporarily since this is still unused. This was added in !167510 (merged)

This is a NOT VALID constraint on the issues table but it causes other updates to fail with:

PG::ForeignKeyViolation: ERROR:  insert or update on table "issues" violates foreign key constraint "fk_1adaba52b0"
DETAIL:  Key (correct_work_item_type_id)=(0) is not present in table "work_item_types".

We have a trigger to fill in correct_work_item_type_id but that only gets triggered when work_item_type_id is also part of the updated columns.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Heinrich Lee Yu

Merge request reports

Loading