Validate not null constraint on projects.project_namespace_id column
In #354616 (closed), we added a not null constraint. It's still marked as invalid. You can run the following to reproduce:
gdk psql
\d+ projects
Output:
Check constraints:
"check_1a6f946a8a" CHECK (organization_id IS NOT NULL)
"check_fa75869cb1" CHECK (project_namespace_id IS NOT NULL) NOT VALID
Implementation guide
We need to validate it by following https://docs.gitlab.com/ee/development/database/not_null_constraints.html#not-null-constraints-on-large-tables:
- Create a merge request using
prepare_async_check_constraint_validationto validate the constraint async as shown in the above link. - Check postgres.ai and see if the constraint is valid using
\d+ projects. If you're a community contributor you can ping@abdwddfor this step. - Use
validate_not_null_constraintto validate it in a new merge request.