stock_items table

The stock_items table in the Inventory Management Database Schema schema has 6 columns, keyed by id, with 2 foreign keys to products and locations.

Available to promise is quantity_on_hand minus quantity_reserved. Both are derived totals, never edited by hand.

Columns (6)

Columns of the stock_items table
ColumnTypeConstraintsDescription
iduuidprimary key
product_iduuidnot null, references products.id
location_iduuidnot null, references locations.id
quantity_on_handintegernot null
quantity_reservedintegernot null
updated_attimestamptznot null

Indexes (2)

  • (product_id, location_id) unique
  • (location_id)

Relationships