How would you design this MySQL database? -
i building blog/forum type website scratch , i'm wondering how best design database. website going have posts, comments , comment threading (reply reply).
posts , comments share lot of same attributes i'm leaning towards storing content in single table called 'posts'. basic gist of table is:
- id
- body
- author
- timestamp
now, i'd love ideas on optimal relationship tables and/or additional columns flag posts threads , comments, , comments @ root level of thread vs in response comment.
if relational database experts can chime in, thanks!
the basic structure this:
post 1----* comment *--- 1 | -------
where post may have many comments, comments can have parent comments , comments can have multiple child comments.
hope helps.
Comments
Post a Comment