GymStock table
The GymStock table in the FitStack - V2 schema has 6 columns, keyed by Id, with 2 foreign keys to GymProductVariants and Gyms. 1 column in GymStockMovements references it.
Merchandise only. Rentals and Services carry no Stock. No soft delete: a row is the count.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| VariantId | uuid | not null, references GymProductVariants.Id | CASCADE. |
| GymId | uuid | not null, references Gyms.Id | |
| OnHand | integer | not null | |
| LowStockThreshold | integer | Null = no alert. | |
| ModifiedAt | timestamp with time zone |
Indexes (1)
(VariantId, GymId)unique (IX_GymStock_VariantId_GymId)
Relationships
GymStock.VariantIdreferencesGymProductVariants.IdGymStock.GymIdreferencesGyms.IdGymStockMovements.StockIdreferencesGymStock