[Plan] Remove old plan associated columns and drop id column from plans table
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Objective
Remove old foreign key constraints, associations, and columns to complete the migration to enum-based plan identifiers.
Prerequisites
- Foreign key constraints created for new columns (#571423)
- Validation period completed successfully
- All systems confirmed working with new associations
Tasks
-
Remove old foreign key constraints:
-
plan_limits.plan_id→plans.id -
gitlab_subscriptions.hosted_plan_id→plans.id - Other old constraints as identified
-
-
Drop old columns from referencing tables:
plan_limits.plan_idgitlab_subscriptions.hosted_plan_idgitlab_subscription_histories.hosted_plan_id- Other old columns as identified
-
Drop the
idcolumn fromplanstable -
Drop the sequence for the old
idcolumn - Remove old associations from models
- Clean up any remaining references in code
- Update database documentation
Safety Measures
- Comprehensive backup before starting
- Staged rollout approach
- Monitor for any issues during deployment
- Have rollback plan ready
- Validate all functionality after cleanup
Migration Strategy
- Remove old foreign key constraints first
- Drop old columns from referencing tables
- Drop
idcolumn and sequence from plans table - Clean up model associations
- Final validation and testing
Acceptance Criteria
- All old foreign key constraints removed
- All old columns dropped successfully
-
Plans table uses only
name_uidas identifier -
No references to old
idcolumn remain - All functionality works correctly
- Database is clean and optimized
- Documentation updated
References
- Parent Epic: Convert `plans` table to be hard-coded in appli... (&19409)
- Original Issue: #519892 (closed)
Edited by 🤖 GitLab Bot 🤖