inventory_movements table

The inventory_movements table in the E-commerce Database Schema schema has 7 columns, keyed by id, with 1 foreign key to inventory_items.

Append-only ledger. quantity is signed. inventory_items.on_hand is the running total and can always be rebuilt from here.

Columns (7)

Columns of the inventory_movements table
ColumnTypeConstraintsDescription
iduuidprimary key
inventory_item_iduuidnot null, references inventory_items.id
typeinventory_movement_typenot null
quantityintegernot null
reference_typevarchar(40)
reference_iduuid
occurred_attimestamptznot null

Indexes (1)

  • (inventory_item_id, occurred_at)

Relationships