Hi all,
I am trying to work through some confusion about relating two tables. My app has a storage component. There are three tables:
- 'Storage Units' are entities that contain spaces to be occupied (like a cabinet)
- 'Storage Slots' are the spaces within a particular unit that can be occupied
- 'Items' are things can occupy slots
However, a storage slot can also be occupied by another storage unit, so there are two relationships that exist. One storage unit contains many slots, and one slot can contain either a unit or an item. I am struggling with how to handle the "parent unit" - "child slot" - "child unit" dichotomy. Is a many-to-many relationship what I need, or do I need to different tables for units?