inventory_items table
The inventory_items table in the E-commerce Database Schema schema has 6 columns, keyed by id, with 2 foreign keys to product_variants and warehouses. 1 column in inventory_movements references it.
Sellable stock is on_hand minus reserved. Reserved rises when an order is placed, on_hand falls when it ships.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| variant_id | uuid | not null, references product_variants.id | |
| warehouse_id | uuid | not null, references warehouses.id | |
| on_hand | integer | not null | |
| reserved | integer | not null | |
| reorder_point | integer |
Indexes (1)
(variant_id, warehouse_id)unique
Relationships
inventory_items.variant_idreferencesproduct_variants.idinventory_items.warehouse_idreferenceswarehouses.idinventory_movements.inventory_item_idreferencesinventory_items