I'm currently working on a project which should help us with our inventory control as well as our purchases to assembly our final product.
We're in the stage of modeling our database and one of the requirements is to generate a BOM (Bill of materials).
I've read this thread and found an example data model for BOM:
conceptual data model and physical data model
but i'm not sure I fully understand.
Our final product consists of a couple of sub-assemblies, so each sub-assembly is a row in the product_hierarchy
table, and the final product also a row in that table. Each sub-assembly is made out of seperate (atomic) parts and each part is identified in a table tpart
(each part has manufacturer field, minimum reorder quantity and other specific fields).
When generating a BOM all separate parts should also be included, so it's not fully clear to me how to model our database:
- a seperate part is a row in
product_hierarchy
which will never be one's 'parent' (the table tpart is no longer needed) - an N:M relationship between
product_hierarchy
andtpart
: each unit has several parts; each part can belong to several units
I'm leaning towards the second alternative, since a part is basically a total different entity (has a price, several possible suppliers, ...) whereas an assemblied entity has no external (as in: outside our company) properties.
Any input is appreciated! Thanks!