Skip to content

Add FKs including partition_id referencing ci_builds

Max Orefice requested to merge morefice/prepare-ci-builds-partitioning-fk-1 into master

Ref: #382033 (closed)

What does this MR do and why?

Step 1 to redefine FK referencing ci_buids.

This MR creates the following migrations to redefine our FK to include the partition_id in order to partition ci_builds.

It takes care of the following models.

  • Ci::UnitTestFailure
  • Ci::BuildPendingState
  • Ci::BuildTraceChunk

And follow a simple strategy using only post migrations as this reference ci_builds a high-traffic table:

  1. Creates an index
  2. Creates the FK
  3. Validates the FK within its own migration for retrying purpose

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Max Orefice

Merge request reports