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)

Columns of the GymStock table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
VariantIduuidnot null, references GymProductVariants.IdCASCADE.
GymIduuidnot null, references Gyms.Id
OnHandintegernot null
LowStockThresholdintegerNull = no alert.
ModifiedAttimestamp with time zone

Indexes (1)

  • (VariantId, GymId) unique (IX_GymStock_VariantId_GymId)

Relationships