Loading
Validate tag_gpg_signatures project_id foreign key
What does this MR do and why?
Contributes to !238703 (merged)
Problem
The tag_gpg_signatures.project_id foreign key was replaced
with ON DELETE CASCADE in
!238703 (merged)
using validate: false and asynchronous validation. The FK
remains marked as NOT VALID in PostgreSQL until
synchronously validated.
Solution
Add a post-deployment migration that calls
validate_foreign_key to synchronously validate the
fk_ebf091e1c4 constraint, completing the two-step FK
replacement process.
References
- Original MR: !238703 (merged)
- Sentry error: https://new-sentry.gitlab.net/organizations/gitlab/issues/3513874
Screenshots or screen recordings
Not applicable — no UI changes.
How to set up and validate locally
- Run
bundle exec rails db:migrate. - Confirm
db/structure.sqlupdates thetag_gpg_signatures.project_idforeign key fromON DELETE CASCADE NOT VALIDtoON DELETE CASCADE.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.