I have data about colors. Some of those colors consist of a number of colors combined. One of those combinations can theoretically be another combined color. In the case of a combined color, I need to define a few attributes about the "child" colors.
I currently have my database defined like so:
COLOR
!Id
+MultiColorGroupId
MULTICOLOR
!Id
+MultiColorGroupId
+ColorId
+Type
This can contain all the information I need in a pretty clear way. The only thing I'm thinking that could happen is that I get a circular reference where a color has itself as childColor. Currently the only way to catch this is by building a check on insert in either the database or the application. As the circle reference could be arbitrarely deep, and the current structure can potentially be rather wide i would prefer a more deterministic data structure.
Are there better ways to define this?