Convert plans table to be hard-coded in application code
The plans table is a simple table with id, name, and title columns. It also has a unique index on the name column. There are two referencing tables, plan_limits and gitlab_subscriptions.
The problem is that each Cell could create in-consistent data where the name does not match id in all cells.
The solution is simple. We need a globally unique reference for each plan. We can have the following enum:
enum :name_uid,
default: 1,
free: 2,
bronze: 3,
silver: 4,
premium: 5,
gold: 6,
ultimate: 7,
ultimate_trial: 8,
ultimate_trial_paid_customer: 9,
premium_trial: 10,
opensource: 11
And drop the id column. We will then use the new name_uid column in all referencing tables.
Another alternative is to drop the plans table entirely, and use a hard-coded list of plans.
References
- https://docs.gitlab.com/development/cells/#static-data
- https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/decisions/014_clusterwide_syncing_in_cells_1_0/
Action items
-
Evaluate which approach to take. Preferred option is the drop the planstable
Edited by 🤖 GitLab Bot 🤖