Skip to content

Validate NOT NULL constraint on ci_runner_taggings.tag_name column

Summary

Validate the NOT NULL constraint on the ci_runner_taggings.tag_name column after it has been added in #573111.

Context

This is part of the work to handle FKs from ci_runner_taggings to tags as tracked in #467664.

Following GitLab's zero-downtime migration best practices, NOT NULL constraints are added in two steps:

  1. Add the constraint with NOT VALID (#573111)
  2. Validate the constraint (this issue) - checks all existing rows to ensure they comply

The validation step must be in a separate post-deployment migration to avoid long-running transactions and potential downtime.

Implementation

  1. Create a post-deployment migration to validate the NOT NULL constraint on ci_runner_taggings.tag_name
  2. Use validate_not_null_constraint helper method
  3. This will check all existing rows without blocking writes
  4. Follow the standard GitLab migration practices for constraint validation

Prerequisites

  • NOT NULL constraint added with NOT VALID (#573111)

Related Issues

Edited by Pedro Pombeiro