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.
- Tables
- 16
- Columns
- 126
- Relationships
- 29
- Enums
- 7
Tables (16)
| Table | Columns | Description |
|---|---|---|
| suppliers | 8 | lead_time_days feeds reorder_rules, which is how a reorder point becomes a purchase suggestion. |
| warehouses | 7 | |
| locations | 8 | Bin-level detail. Stock is held at a location, never merely at a warehouse, so a pick list can name an exact shelf. |
| product_categories | 3 | Self-referencing tree. parent_id null is a top-level category. |
| products | 12 | unit_cost_cents is the standard cost used for valuation. Actual paid cost lives on the purchase order line. |
| stock_items | 6 | Available to promise is quantity_on_hand minus quantity_reserved. Both are derived totals, never edited by hand. |
| stock_movements | 10 | The 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_rules | 6 | Per warehouse, not global. A slow regional depot should not be restocked on the same trigger as the main hub. |
| purchase_orders | 12 | Money in minor units as integers. Totals are snapshotted when the order is sent. |
| purchase_order_lines | 9 | 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. |
| goods_receipts | 7 | One PO can be received in several deliveries. That is why receipts are their own table rather than columns on the PO. |
| goods_receipt_lines | 7 | Only quantity_accepted writes a positive stock_movement. Rejected goods are recorded but never enter sellable stock. |
| stock_transfers | 8 | Stock 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_lines | 7 | quantity_received null until the far end confirms. A shortfall against quantity_sent is shrinkage and should raise an exception. |
| stock_counts | 7 | A cycle count is the only sanctioned way to change stock without a business event behind it. |
| stock_count_lines | 9 | expected_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.