locations table
The locations table in the Inventory Management Database Schema schema has 8 columns, keyed by id, with 1 foreign key to warehouses. 6 columns in stock_items, stock_movements, goods_receipt_lines, stock_transfer_lines and 1 more reference it.
Bin-level detail. Stock is held at a location, never merely at a warehouse, so a pick list can name an exact shelf.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| warehouse_id | uuid | not null, references warehouses.id | |
| code | varchar(40) | not null | |
| type | location_type | not null | |
| aisle | varchar(20) | ||
| rack | varchar(20) | ||
| shelf | varchar(20) | ||
| is_pickable | boolean | not null |
Indexes (2)
(warehouse_id, code)unique(warehouse_id, type)
Relationships
locations.warehouse_idreferenceswarehouses.idstock_items.location_idreferenceslocationsstock_movements.location_idreferenceslocationsgoods_receipt_lines.location_idreferenceslocationsstock_transfer_lines.from_location_idreferenceslocationsstock_transfer_lines.to_location_idreferenceslocationsstock_count_lines.location_idreferenceslocations