Wrote first draft of sections database scheme
This commit is contained in:
parent
a295237863
commit
211e31a008
3 changed files with 90 additions and 1 deletions
|
|
@ -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,
|
||||
);
|
||||
|
|
|
|||
Reference in a new issue