Or: one comment table for each entity type
Or: one main Entity table with child comments and specific EntityType tables.
- EntityMaster: EntityID, foo, bar
- Comments: EntityID, CommentID, UserID, ... PK (EntityID, CommentID, etc.)
For tables 3 Entity PK is EntityID
- EntityOne: EntityID, EntityTypeID (check constraint = 1), ...
- EntityTwo: EntityID, EntityTypeID (check constraint = 2), ...
- EntityThree: EntityID, EntityTypeID (check constraint = 3), ...
The lack of a label or elegance in the fact that one parent has one comment table for 3 parents: this is wrong in the conditions of database development.
Personally, I would probably go for option 1 ...
Change to reflect:
Sometimes you have to look at data usage.
, , 1.
, 2 , .