S
S
Sergey Khlopov2019-12-15 14:53:05
Database design
Sergey Khlopov, 2019-12-15 14:53:05

How to properly organize the link between articles and comments?

Hello, tell me please, I have a table for articles in the database - articles
Now I will make a table - comments for comments.
And the question itself is how to build links between articles and comments more correctly? As long as you can reply to comments. As a result, I have now come to the conclusion that in comments I should have the
article_id and parent_id fields, right?
Thank you in advance for your response

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton R., 2019-12-15
@Shlop

id
article_id
parent_id
user_id
text
time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question