purchase_order_lines table
The purchase_order_lines table in the Inventory Management Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to purchase_orders and products. 1 column in goods_receipt_lines references it.
sku and description are copied, not joined. Renaming a product must not change what an old PO says was ordered. quantity_received is a rollup of the receipt lines below.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| purchase_order_id | uuid | not null, references purchase_orders.id | |
| product_id | uuid | not null, references products.id | |
| sku | varchar(64) | not null | |
| description | varchar(255) | not null | |
| quantity_ordered | integer | not null | |
| quantity_received | integer | not null | |
| unit_cost_cents | integer | not null | |
| amount_cents | integer | not null |
Indexes (2)
(purchase_order_id)(product_id)
Relationships
purchase_order_lines.purchase_order_idreferencespurchase_orders.idpurchase_order_lines.product_idreferencesproducts.idgoods_receipt_lines.purchase_order_line_idreferencespurchase_order_lines