I have various 'named objects' that have some shared properties and I think it might make the most sense to save them in the following format in my database:
NamedObjectWrapper- ID
- CreatedBy
- Name
- ...
(here is my tagged union)
- NamedObjectType
- NamedObject1 (FK NULLable)
- NamedObject2 (FK NULLable)
- NamedObject3 (FK NULLable)
NamedObject1- ...
NamedObject2- ...
NamedObject3- ...
Exactly one of NamedObject1, NamedObject2, and NamedObject3 will be set, and the other two null. Is the above an OK way to do this? I suppose the more-relational way to do it, by just storing three tables with all the repetitive properties is fine, but I'll be UNION-ing those three tables together all the time, so I think this saves me a lot of work doing it this way.