Add sharding_key_id to ci_runners table
What does this MR do and why?
The changes in this MR are needed because in !166308, we'll be creating a partitioned copy of the table with an automated trigger to copy data from ci_runners
to the partitioned table. If we don't have all the required columns, the check constraint will fail on the target table.
This MR:
- Adds a
sharding_key_id
column to theci_runners
table. - Adds logic to populate
sharding_key_id
when a runner is created, registered, or reassigned to a different owner project. - Adds a post-deployment migration to backfill the field from
ci_runner_namespaces
andci_runner_projects
.
Changelog: added
Part of #493256 (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
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
n/a
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
n/a