GymProductVariants table
The GymProductVariants table in the FitStack - V2 schema has 13 columns, keyed by Id, with 1 foreign key to GymProducts. 3 columns in GymStock, OrderLines and MembershipAddOns reference it.
Columns (13)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| ProductId | uuid | not null, references GymProducts.Id | CASCADE. |
| Name | character varying(200) | not null | e.g. "M / Black". A product with no options has one Variant named like the product. |
| Sku | character varying(100) | ||
| PriceCents | integer | not null | |
| Currency | character varying(3) | not null | |
| OptionsJson | jsonb | {"size":"M","colour":"Black"} | |
| StripePriceId | text | ||
| IsActive | boolean | not null | |
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (2)
(ProductId)(IX_GymProductVariants_ProductId)(Sku)unique (IX_GymProductVariants_Sku)
Relationships
GymProductVariants.ProductIdreferencesGymProducts.IdGymStock.VariantIdreferencesGymProductVariantsOrderLines.VariantIdreferencesGymProductVariantsMembershipAddOns.VariantIdreferencesGymProductVariants