50 lines
895 B
Rust
50 lines
895 B
Rust
table! {
|
|
posts (id) {
|
|
id -> Uuid,
|
|
section_id -> Uuid,
|
|
is_private -> Bool,
|
|
is_archived -> Bool,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
sections (id) {
|
|
id -> Uuid,
|
|
title -> Varchar,
|
|
shortname -> Varchar,
|
|
description -> Nullable<Text>,
|
|
is_default -> Bool,
|
|
has_titles -> Bool,
|
|
is_private -> Bool,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
tags (post_id, value) {
|
|
post_id -> Uuid,
|
|
value -> Varchar,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
versions (id) {
|
|
id -> Uuid,
|
|
post_id -> Uuid,
|
|
title -> Nullable<Varchar>,
|
|
publish_date -> Nullable<Date>,
|
|
content -> Text,
|
|
is_draft -> Bool,
|
|
}
|
|
}
|
|
|
|
joinable!(posts -> sections (section_id));
|
|
joinable!(tags -> posts (post_id));
|
|
joinable!(versions -> posts (post_id));
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
|
posts,
|
|
sections,
|
|
tags,
|
|
versions,
|
|
);
|