The problem is to store a user defined tree of "Categories" and "Image Galleries" in a database. Categories can contain either or both Categories and Image Galleries.
I have Joe Celko's book on Trees and Hierarchies in SQL for Smarties and will be implementing the Nested Set Model to hold the hierarchy.
What I cannot figure out is how best to deal with the details. Both a Category and Image Gallery have somethings in common. The Category has one or two attributes the Image Gallery doesn't have. The Image Gallery has a lot of attributes in which the Category does not.
Should I simply create one details table that has all the attributes of both and add a column that is a flag to determine if the row is a Image Gallery or Category?
Should the hierarchy tree have one FK that goes to two different detail tables, one for Category, one for Image Gallery?
Should the hierarchy tree have two FK, one always being blank, one to the Category, the other to the Image Gallery?