Add NOT NULL on sharding key for ci_build_needs
What does this MR do and why?
Adds NOT NULL constraint on the sharding key column project_id on table: ci_build_needs. The constraint will be validated asynchronously because the table's size is overlimit.
Note: We do not add presence: true check because we're relying on "BEFORE INSERT OR UPDATE" trigger to populate
the column from its parent table. We have no defined plan yet for the removal of these triggers but we will ensure
that application code is writing the value first removing them.
References
- Organization Isolation and Sharding Keys: https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/organization/isolation/
- Sharding Key (Cells) Development Guide: https://docs.gitlab.com/ee/development/cells/#defining-a-sharding-key-for-all-cell-local-tables
- Related to #493768 (closed)
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
N/A
How to verify
N/A
Edited by Shane Maglangit