Add ci_deleted_objects#project_id not null constraint

Ref: #463245 (closed)

What does this MR do and why?

This MR enforces our new not null constraint at the database level to prevent creating records without a project, it does 4 things:

  • Finalizes our migration
  • Migration for self-managed to make sure we don't have any invalid records
  • Adds the not null constraint
  • Sets the sharding key for ci_deleted_objects

Explanation

The backfill has been completed and we don't have any records left without a project_id.

gitlabhq_dblab=# select count(*) from ci_deleted_objects where project_id is null;
 count
-------
     0
(1 row)
Edited by Max Orefice

Merge request reports

Loading