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)

Columns of the ClassPrices table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
ClassIduuidnot null, references Classes.IdADDED: 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.
SubscriptionIduuidnot null, references GymSubscriptions.Id
Pricenumeric(8,2)not null

Indexes (1)

  • (ClassId, SubscriptionId) unique (IX_ClassPrices_ClassId_SubscriptionId)

Relationships