I am creating a database for an application where the user can comment on images and videos.
Should I keep separate tables for comments such as (Picture_comments and videos_comments)
OR
should I keep separate tables for comments and other mapping tables such as (picture_comment_mapping and video_comment_mapping).
Which one is better and why?
Details
Approach 1:
user
id
name
Picture
id
link
video
id
link
comment_video
id
user_id
video_id
comment
comment_picture
id
user_id
picture_id
comment
Approach 2:
user
id
name
picture
id
link
video
id
link
comment
id
user_id
comment
comment_picture_mapping
id
comment_id
picture_id
comment_video_mapping
id
comment_id
video_id
Which one is better and why?
source
share