So, I'm building a website and I'm going to have standard CMS tables like Article, Blog, Poll, etc. I want to let users post comments to any of these items. So my question is, do I need to create separate comments tables for each (e.g. ArticleComment, BlogComment, PollComment), or can I just make a generic Comment table that could be used with any table? What has worked for people?
Method 1: Many Comment Tables
- Article {ArticleID [PK], Title, FriendlyUrl}
- ArticleComment {ArticleCommendID [PK], ArticleID [FK], Comment}
- Blog {BlogID, Title, PubDate, Category}
- BlogComment {BlogCommendID [PK], BlogID [FK], Comment}
- Poll {PollID, Title, IsClosed}
- PollComment {PollCommentID [PK], PollID [FK], Comment}
Method 2: Single Comment Table
- Article {ArticleID [PK], Title, FriendlyUrl}
- Blog {BlogID, Title, PubDate, Category}
- Poll {PollID, Title, IsClosed}
- Comment {CommentID [PK], ReferenceID [FK], Comment}