Wrote first draft of sections database scheme

This commit is contained in:
Jef Roosens 2021-09-13 17:18:33 +02:00
parent a295237863
commit 211e31a008
Signed by: Jef Roosens
GPG key ID: 955C0660072F691F
3 changed files with 90 additions and 1 deletions

View file

@ -1,3 +1,13 @@
table! {
posts (id) {
id -> Uuid,
section_id -> Uuid,
title -> Nullable<Varchar>,
publish_date -> Date,
content -> Text,
}
}
table! {
refresh_tokens (token) {
token -> Bytea,
@ -7,6 +17,16 @@ table! {
}
}
table! {
sections (id) {
id -> Uuid,
title -> Varchar,
description -> Nullable<Text>,
is_default -> Bool,
has_titles -> Bool,
}
}
table! {
users (id) {
id -> Uuid,
@ -17,6 +37,12 @@ table! {
}
}
joinable!(posts -> sections (section_id));
joinable!(refresh_tokens -> users (user_id));
allow_tables_to_appear_in_same_query!(refresh_tokens, users,);
allow_tables_to_appear_in_same_query!(
posts,
refresh_tokens,
sections,
users,
);