Inventory Management Database Schema database schema
The Inventory Management Database Schema database schema is a DB Planner template with 16 tables, 126 columns and 29 relationships, free to use. Core tables include goods_receipt_lines, goods_receipts, locations, product_categories. It can be opened as an interactive diagram or exported as PostgreSQL, MySQL, or MSSQL DDL.
- Tables
- 16
- Columns
- 126
- Relationships
- 29
- Category
- Logistics
- Exports
- DBML, SQL, C#
- Price
- Free
What this schema models
A warehouse inventory management database schema built around one idea that most stock systems get wrong: stock_movements is an append-only ledger and it is the ONLY source of truth. 16 tables, 7 enums and 29 relationships covering suppliers, warehouses, bin-level locations, a product catalog, live stock levels, reorder rules, purchasing, receiving, inter-warehouse transfers and cycle counts. THE LEDGER PATTERN stock_items.quantity_on_hand is a cached running total kept for fast reads — it can always be rebuilt by summing the ledger. Every other table here (goods receipts, transfers, cycle counts) ultimately just writes movement rows with a signed quantity and a reference back to the document that caused them. That is the difference between stock you can audit and stock that is merely current. When the numbers disagree with the shelf, you can prove where they diverged. WHAT IT MODELS THAT SIMPLER EXAMPLES SKIP - Bin-level locations, not just warehouses. Stock is held at an aisle/rack/shelf location, so a pick list can name an exact bin, and locations carry a type (receiving, storage, picking, packing, quarantine, shipping). - Available to promise. quantity_on_hand minus quantity_reserved, both derived, never hand-edited. - Partial receiving. One purchase order can be received across several deliveries, which is why goods_receipts is its own table rather than a set of columns on the PO. Receipt lines separate quantity_accepted from quantity_rejected — only accepted stock writes a positive movement. - Stock in transit. A transfer writes the negative movement when it ships and the positive one when it lands. The gap between them is visible on purpose, and a shortfall against quantity_sent is shrinkage you can alert on. - Cycle counts as the only sanctioned way to change stock with no business event behind it. expected_quantity is frozen when the count sheet is generated; approving a variance writes an adjustment movement. - Purchase order lines copy sku and description rather than joining live, so renaming a product never rewrites what an old PO says was ordered. - Money in minor units as integers. Never floats. WHAT YOU GET Clean DBML that imports straight into DB Planner, plus a laid-out board with cards colour-coded by lifecycle stage — partners, facilities, catalog, stock state, purchasing, receiving, transfers and counts — with sticky notes explaining the reasoning behind each zone and every table carrying its own Note. Postgres-flavoured types that port cleanly to MySQL or SQL Server. Good starting point for developers building a WMS or inventory backend, students who need a realistic inventory management ER diagram, and ops teams outgrowing a spreadsheet.
Tables (16)
| Table | Columns |
|---|---|
| goods_receipt_lines | 7 |
| goods_receipts | 7 |
| locations | 8 |
| product_categories | 3 |
| products | 12 |
| purchase_order_lines | 9 |
| purchase_orders | 12 |
| reorder_rules | 6 |
| stock_count_lines | 9 |
| stock_counts | 7 |
| stock_items | 6 |
| stock_movements | 10 |
| stock_transfer_lines | 7 |
| stock_transfers | 8 |
| suppliers | 8 |
| warehouses | 7 |
Relationships (29)
goods_receipt_lines.goods_receipt_id references goods_receipts.idmany to onegoods_receipt_lines.location_id references locations.idmany to onegoods_receipt_lines.purchase_order_line_id references purchase_order_lines.idmany to onegoods_receipts.purchase_order_id references purchase_orders.idmany to onegoods_receipts.warehouse_id references warehouses.idmany to onelocations.warehouse_id references warehouses.idmany to oneproduct_categories.parent_id references product_categories.idmany to oneproducts.category_id references product_categories.idmany to oneproducts.preferred_supplier_id references suppliers.idmany to onepurchase_order_lines.product_id references products.idmany to onepurchase_order_lines.purchase_order_id references purchase_orders.idmany to onepurchase_orders.supplier_id references suppliers.idmany to onepurchase_orders.warehouse_id references warehouses.idmany to onereorder_rules.product_id references products.idmany to onereorder_rules.warehouse_id references warehouses.idmany to onestock_count_lines.location_id references locations.idmany to onestock_count_lines.product_id references products.idmany to onestock_count_lines.stock_count_id references stock_counts.idmany to onestock_counts.warehouse_id references warehouses.idmany to onestock_items.location_id references locations.idmany to onestock_items.product_id references products.idmany to onestock_movements.location_id references locations.idmany to onestock_movements.product_id references products.idmany to onestock_transfer_lines.from_location_id references locations.idmany to onestock_transfer_lines.product_id references products.idmany to onestock_transfer_lines.stock_transfer_id references stock_transfers.idmany to onestock_transfer_lines.to_location_id references locations.idmany to onestock_transfers.from_warehouse_id references warehouses.idmany to onestock_transfers.to_warehouse_id references warehouses.idmany to one
How to use this template
- Open the diagram to see the tables and how they relate.
- Copy it into your workspace. You get your own editable copy.
- Export it as PostgreSQL, MySQL, or MSSQL DDL, or as C# models.
Frequently asked questions
- What is in the Inventory Management Database Schema schema?
- 16 tables and 29 relationships, across 126 columns. The table names and the full relationship list are shown on this page.
- Can I export it to PostgreSQL or MySQL?
- Yes. Every DB Planner template exports as DBML, PostgreSQL, MySQL, or MSSQL DDL, and as C# models.
- Is this template free?
- Yes. You can open it in the browser without an account, and copy it into your own workspace with a free DB Planner account.
- Can I change it after copying it?
- Yes. A copy is yours: you can rename tables, add columns, and export it. Changes the author makes later do not affect your copy.