Add NOT NULL constraint to notes.namespace_id
As part of &12795 we need to add sharding keys to all our tables. notes
already has project_id
from way-back, however sharding keys are required to be NOT NULL
so we will need to embark on the multi-release process of migrating that column, as outlined here: https://docs.gitlab.com/ee/development/database/not_null_constraints.html#add-a-not-null-constraint-to-an-existing-column
This will delay completion of adding sharding keys to tables that want to backfill their own sharding keys from notes
.
Order of Work
-
Delete abuse_notes
records -
Add not null constraint on notes.namespace_id
-
Set notes.namespace_id
as the sharding key fornotes
Edited by Kerri Miller