Add plan_name_uid columns to referencing tables

Objective

Add new plan_name_uid and hosted_plan_name_uid columns to all tables that reference the plans table and create backfill migrations.

Prerequisites

Scope

Add new columns to tables that reference plans:

  • plan_limits → add plan_name_uid
  • gitlab_subscriptions → add hosted_plan_name_uid
  • gitlab_subscription_histories → add hosted_plan_name_uid
  • ci_pending_builds → add plan_name_uid (if applicable)
  • instance_type_ci_runners → add plan_name_uid (if applicable)
  • project_type_ci_runners → add plan_name_uid (if applicable)

Tasks

  • Create migrations to add new columns to all referencing tables
  • Add indexes on new columns for performance

Migration Strategy

For each table:

  1. Add new *_name_uid column as nullable integer
  2. Add index on new column

Acceptance Criteria

  • All referencing tables have new *_name_uid columns
  • Indexes created for performance
  • No data loss during migration
  • Migrations are reversible
  • Edge cases handled appropriately

References

Edited by 🤖 GitLab Bot 🤖