purchase_orders table

The purchase_orders table in the Inventory Management Database Schema schema has 12 columns, keyed by id, with 2 foreign keys to suppliers and warehouses. 2 columns in purchase_order_lines and goods_receipts reference it.

Money in minor units as integers. Totals are snapshotted when the order is sent.

Columns (12)

Columns of the purchase_orders table
ColumnTypeConstraintsDescription
iduuidprimary key
supplier_iduuidnot null, references suppliers.id
warehouse_iduuidnot null, references warehouses.id
numbervarchar(32)unique, not null
statuspurchase_order_statusnot null
currencychar(3)not null
subtotal_centsintegernot null
tax_centsintegernot null
total_centsintegernot null
ordered_attimestamptz
expected_atdate
created_attimestamptznot null

Indexes (2)

  • (supplier_id, ordered_at)
  • (status, expected_at)

Relationships