Blog Schema (DBML)
Users, posts, comments and a tag many-to-many.
Make it your own.
Table users {
id uuid [pk]
email varchar [unique, not null]
name varchar
created_at timestamp
}
Table posts {
id uuid [pk]
author_id uuid [ref: > users.id]
title varchar [not null]
body text
published boolean
created_at timestamp
}
Table comments {
id uuid [pk]
post_id uuid [ref: > posts.id]
author_id uuid [ref: > users.id]
body text
created_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]
}