ClassPrices table
The ClassPrices table in the FitStack - V2 schema has 4 columns, keyed by Id, with 2 foreign keys to Classes and GymSubscriptions.
Lets a gym charge different prices for the same class depending on the member's subscription tier.
Columns (4)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| ClassId | uuid | not null, references Classes.Id | ADDED: the Gym board had no link from a price to the class it prices — only to a subscription tier, which made the row meaningless on its own. |
| SubscriptionId | uuid | not null, references GymSubscriptions.Id | |
| Price | numeric(8,2) | not null |
Indexes (1)
(ClassId, SubscriptionId)unique (IX_ClassPrices_ClassId_SubscriptionId)
Relationships
ClassPrices.ClassIdreferencesClasses.IdClassPrices.SubscriptionIdreferencesGymSubscriptions.Id