I'm sure this question has been answered many times but I couldn't find a simple answer to this one. I'm creating a database with components that could be nested.
Component 1
- Component 2
- Component 3
Component 4
- Component 5
- Component 6
- Component 7
- Component 8
This could also be ordered differently with the same components
Component 3
- Component 1
- Component 4
Component 5
- Component 7
- Component 8
- Component 2
- Component 6
What would be the best way to build my Postgres database?
I have a components
table but I'm not sure how should I build the relation. If I create a relation table with parent
/ child
, how do I get the multiple ordering?