Add NOT NULL (NOT VALID) constraint on gpg_signatures#project_id
What does this MR do and why?
Add NOT NULL (NOT VALID) constraint on gpg_signatures#project_id
Epic: &11670
Addresses #555251
There are noo rows where project_id is NULL: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42015/commands/129065
This is a large table (https://postgres.ai/console/gitlab/gitlab-production-main/sessions/42015/commands/129066) and I will shard it in two steps: 1- (this MR) add a not null constraint with validate: false + prepare an asyn constraint validation 2- (another MR) validate project_id NOT NULL
- gpg_signatures#project_id is enforced through https://gitlab.com/gitlab-org/gitlab/-/blob/3ad8e7660a5facf83a1772ef1876b140f2684493/app/models/concerns/commit_signature.rb\#L14
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.