products table
The products table in the Inventory Management Database Schema schema has 12 columns, keyed by id, with 2 foreign keys to product_categories and suppliers. 6 columns in stock_items, stock_movements, reorder_rules, purchase_order_lines and 2 more reference it.
unit_cost_cents is the standard cost used for valuation. Actual paid cost lives on the purchase order line.
Columns (12)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| category_id | uuid | references product_categories.id | |
| preferred_supplier_id | uuid | references suppliers.id | |
| sku | varchar(64) | unique, not null | |
| name | varchar(255) | not null | |
| description | text | ||
| unit_of_measure | unit_of_measure | not null | |
| unit_cost_cents | integer | not null | |
| currency | char(3) | not null | |
| barcode | varchar(64) | unique | |
| is_serialized | boolean | not null | |
| is_active | boolean | not null |
Indexes (2)
(category_id, is_active)(name)
Relationships
products.category_idreferencesproduct_categories.idproducts.preferred_supplier_idreferencessuppliers.idstock_items.product_idreferencesproductsstock_movements.product_idreferencesproductsreorder_rules.product_idreferencesproductspurchase_order_lines.product_idreferencesproductsstock_transfer_lines.product_idreferencesproductsstock_count_lines.product_idreferencesproducts