I have a question regarding the correct implementation of a Schema that I'm currently wrecking my head with:
We have machines, which consist of components, which consist of parts.
However, the relationships are as follows:
- Machines (1) --> Components (N) - a machine is made up of various components
- Components (N) --> Parts (N) - a component is made up of multiple parts, a part may be used in multiple components
- Components (N) --> Components (N) - a component can also be made up of other components
- Machines (N) --> Parts (N) - Some parts may also be directly assigned to a machine
Furthermore, both parts and components that are flagged as needs_welding=1 will have a price associated with them. These prices will change over time.
I'm not quite sure as to how to model the following aspects:
- How to relate the Parts directly to the machine table
- How to model the parent/child relationship between the components
- How to attach prices to the items (kinda reminds me of an SCD in a DWH, but I cannot seem to patch it together)