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)

Columns of the purchase_order_lines table
ColumnTypeConstraintsDescription
iduuidprimary key
purchase_order_iduuidnot null, references purchase_orders.id
product_iduuidnot null, references products.id
skuvarchar(64)not null
descriptionvarchar(255)not null
quantity_orderedintegernot null
quantity_receivedintegernot null
unit_cost_centsintegernot null
amount_centsintegernot null

Indexes (2)

  • (purchase_order_id)
  • (product_id)

Relationships