Inventory Management Database Schema database schema

The Inventory Management Database Schema database schema by Colton Bristow has 16 tables (suppliers, warehouses, locations, product_categories and 12 more), 126 columns and 29 relationships, documented column by column.

ER diagram of the Inventory Management Database Schema schema, showing 16 tables and their relationships
FIG. 1: entity relationship diagram, 16 tables
Tables
16
Columns
126
Relationships
29
Enums
7

Tables (16)

Tables in the Inventory Management Database Schema schema
TableColumnsDescription
suppliers8lead_time_days feeds reorder_rules, which is how a reorder point becomes a purchase suggestion.
warehouses7
locations8Bin-level detail. Stock is held at a location, never merely at a warehouse, so a pick list can name an exact shelf.
product_categories3Self-referencing tree. parent_id null is a top-level category.
products12unit_cost_cents is the standard cost used for valuation. Actual paid cost lives on the purchase order line.
stock_items6Available to promise is quantity_on_hand minus quantity_reserved. Both are derived totals, never edited by hand.
stock_movements10The ledger. quantity is signed: positive adds, negative removes. reference_type and reference_id point back at the receipt, transfer or count that caused it.
reorder_rules6Per warehouse, not global. A slow regional depot should not be restocked on the same trigger as the main hub.
purchase_orders12Money in minor units as integers. Totals are snapshotted when the order is sent.
purchase_order_lines9sku 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.
goods_receipts7One PO can be received in several deliveries. That is why receipts are their own table rather than columns on the PO.
goods_receipt_lines7Only quantity_accepted writes a positive stock_movement. Rejected goods are recorded but never enter sellable stock.
stock_transfers8Stock in transit belongs to neither end. Shipping writes the negative movement, receiving writes the positive one, and the gap between them is visible on purpose.
stock_transfer_lines7quantity_received null until the far end confirms. A shortfall against quantity_sent is shrinkage and should raise an exception.
stock_counts7A cycle count is the only sanctioned way to change stock without a business event behind it.
stock_count_lines9expected_quantity is frozen when the count sheet is generated. Approving a non-zero variance writes an adjustment movement.

Enums (7)

unit_of_measure
each, kilogram, gram, litre, metre, box, pallet
location_type
receiving, storage, picking, packing, quarantine, shipping
movement_type
receipt, sale, transfer_out, transfer_in, adjustment, return, scrap
purchase_order_status
draft, submitted, approved, partially_received, received, cancelled
receipt_status
pending, completed, cancelled
transfer_status
draft, in_transit, received, cancelled
count_status
scheduled, in_progress, pending_approval, approved, cancelled

Document your own schema

This page is published from DB Planner, a collaborative ER diagram tool. Write the schema in the DBML editor or import it from SQL, then publish docs like these from the project's sharing settings.

More published database schemas