In our business application, we have a need to store user or system generated “comments” about a particular entity. For example, comments can be created about a customer, an order, or a purchase order. These comments all share many of the same characteristics, with the exception of the referenced entity.
All comments require the date, time, user, and comment text. They also require a foreign key to the referenced table so that you can look up comments for that particular entity.
Currently the application has a separate table for each type of comment (e.g. customer_comments, order_comments, purchaseOrder_comments). The schemas of these tables are all identical with respect to the date, time, user and comment text, but each has a FK to the respective table that the comment is for.
Is this the best design or is there a better design?
Personally, I’d create a single comment table and then use one intersection table per entity (customer, order, etc.) to link the comment with the entity.