Remove NOT NULL constraint from snippet_repositories.shard_id
Why
Part of the work to add organization_id as sharding key to snippet_repositories: #550705 (closed)
On the snippets_repositories table, before we can set organization_id as the sharding key, we have to swap shard_id to be a LFK with async_nullify.
We cannot retain a NOT NULL constraint on a column that will async nullify, as it would be invalid.
What
We need to follow the steps to remove a NOT NULL constraint from an existing table.
Documentation: https://docs.gitlab.com/development/database/not_null_constraints/#dropping-a-not-null-constraint-on-a-column-in-an-existing-table
Edited by 🤖 GitLab Bot 🤖