Add NOT NULL to issue_customer_relations_contacts

What does this MR do and why?

Adds NOT NULL constraint on sharding key column namespace_id on table: issue_customer_relations_contacts.

This merge request is the last step towards transforming the desired sharding key into a sharding key.

This involves the following changes:

  • Adding a not null constraint for the sharding key columns (namespace_id).
  • Setting namespace_id as sharding_key of issue_customer_relations_contacts.

We are skipping model-level validations when adding NOT NULL for now: !189213 (comment 2480466972)

The backfill migration was run and finalized: https://gitlab.com/gitlab-org/gitlab/blob/d86b24e21c32e8c329dd6cc8613f4ec152d65446/db/docs/batched_background_migrations/backfill_issue_customer_relations_contacts_namespace_id.yml

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading