I have been trying to create an online discussion forum as a fun project. In this application, registered users can create a "topic". Other users can reply to that topic (lets call them "posts"). Also, people can "reply" to posts . However, reply to "replies" is not required at present.
I thought of creating a DB schema like this
But, the posts and replies table basically contain the same kind of fields. Only exception is that- the topic_id column in posts table will refer to topics table and post_id column in replies table will refer to the posts table
So, if I have to keep only one table for posts and replies, how do I manage the relationship between "topics and posts" and "posts and replies" ? What would be the ideal solution in this case?
Or
Should I just keep my existing schema?
Thanks!