GymStockMovements table

The GymStockMovements table in the FitStack - V2 schema has 8 columns, keyed by Id, with 3 foreign keys to GymStock, Orders and Employees.

Append-only ledger; OnHand is the sum. No audit columns.

Columns (8)

Columns of the GymStockMovements table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
StockIduuidnot null, references GymStock.IdCASCADE.
Deltaintegernot nullNegative for Sale.
Reasontextnot null`StockMovementReason`.
OrderIduuidreferences Orders.IdFor Sale and Return.
EmployeeIduuidreferences Employees.Id
Notescharacter varying(500)
Attimestamp with time zonenot null

Indexes (1)

  • (StockId, At) (IX_GymStockMovements_StockId_At)

Relationships