OrderLines table
The OrderLines table in the FitStack - V2 schema has 7 columns, keyed by Id, with 2 foreign keys to Orders and GymProductVariants.
No audit columns: lines live and die with the Order.
Columns (7)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| OrderId | uuid | not null, references Orders.Id | CASCADE. |
| VariantId | uuid | not null, references GymProductVariants.Id | RESTRICT. |
| NameSnapshot | character varying(300) | not null | Product + Variant name as sold. |
| Quantity | integer | not null | |
| UnitPriceCents | integer | not null | |
| TaxCents | integer | not null |
Indexes (1)
(OrderId)(IX_OrderLines_OrderId)
Relationships
OrderLines.OrderIdreferencesOrders.IdOrderLines.VariantIdreferencesGymProductVariants.Id