Answer the question
In order to leave comments, you need to log in
How to properly structure the database for comments?
Good afternoon. The task is to make a system of threads on the site. That is, there is a post under which you can leave a comment, comments can be answered. A file can be attached to the comments.
I don't know yet how to design the database structure for comments. The first thing that comes to mind is:
id_comment
user_id
text
file
parent_id
created_at
I have serious doubts about such a structure. Tell me something better? Thank you!
Answer the question
In order to leave comments, you need to log in
Not the fact that the solution, but for development , be sure to read
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question