Blog schema (posts, tags, comments)
Posts with many-to-many tags via a join table, threaded comments, authors.
Make it your own.
Table authors {
id uuid [pk]
handle varchar [unique]
display_name varchar
}
Table posts {
id uuid [pk]
author_id uuid [ref: > authors.id]
slug varchar [unique]
title varchar
body text
published_at timestamp
}
Table tags {
id uuid [pk]
name varchar [unique]
}
Table post_tags {
post_id uuid [ref: > posts.id]
tag_id uuid [ref: > tags.id]
indexes {
(post_id, tag_id) [pk]
}
}
Table comments {
id uuid [pk]
post_id uuid [ref: > posts.id]
parent_id uuid [ref: > comments.id, null]
author_name varchar
body text
at timestamp
}