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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| product_id | uuid | not null, references products.id | |
| location_id | uuid | not null, references locations.id | |
| quantity_on_hand | integer | not null | |
| quantity_reserved | integer | not null | |
| updated_at | timestamptz | not null |
Indexes (2)
(product_id, location_id)unique(location_id)
Relationships
stock_items.product_idreferencesproducts.idstock_items.location_idreferenceslocations.id