Add plan_name_uid column to plans table
What does this MR do and why?
This MR adds plan_name_uid to plans table. This column will be used to convert the plans table to have hard-coded primary key and globally unique reference for Cells infrastructure.
- Plans table is a small table with total
12 rowsonly. - new records can only inserted via database migration
- Example MR: !135759 (diffs)
- Thus, there is no significant application code that creates new record, or updates existing record.
- Only two places seems to have
find_or_createfor default plan and free plan-
Plan.default
- The default plan is already present in
Gitlab.com - SaaS - And for self-managed, it is seeded during initialization
- The default plan is already present in
-
Plan.free
- This is only for
SaaS - Gitlab.comand we already have this record in the database created
- This is only for
- In any case, we have
before_validatehook to set the plan if needed for development scripts.
-
Plan.default
Database
gitlabhq_dblab=# select name, title from plans;
name | title
------------------------------+----------------------------------
default | Default
early_adopter | GitLab.com Early Adopter
bronze | Bronze
silver | Silver
gold | Gold
free | Free
ultimate_trial | Ultimate Trial
premium_trial | Premium Trial
opensource | Open Source Program
premium | Premium
ultimate | Ultimate
ultimate_trial_paid_customer | Ultimate Trial for Paid Customer
(12 rows)
References
How to set up and validate locally
- Green CI
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.
Edited by Bishwa Hang Rai