This repository has been archived on 2023-07-04. You can view files and clone it, but cannot push or open issues/pull-requests.
2021-11-23 17:49:31 +01:00
|
|
|
table! {
|
|
|
|
posts (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
section_id -> Uuid,
|
2021-12-23 16:28:43 +01:00
|
|
|
is_private -> Bool,
|
|
|
|
is_archived -> Bool,
|
2021-11-23 17:49:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
sections (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
title -> Varchar,
|
|
|
|
shortname -> Varchar,
|
|
|
|
description -> Nullable<Text>,
|
|
|
|
is_default -> Bool,
|
|
|
|
has_titles -> Bool,
|
2021-12-23 16:28:43 +01:00
|
|
|
is_private -> Bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-23 23:28:26 +01:00
|
|
|
table! {
|
|
|
|
tags (post_id, value) {
|
|
|
|
post_id -> Uuid,
|
|
|
|
value -> Varchar,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-23 16:28:43 +01:00
|
|
|
table! {
|
|
|
|
versions (id) {
|
|
|
|
id -> Uuid,
|
|
|
|
post_id -> Uuid,
|
|
|
|
title -> Nullable<Varchar>,
|
|
|
|
publish_date -> Nullable<Date>,
|
|
|
|
content -> Text,
|
|
|
|
is_draft -> Bool,
|
2021-11-23 17:49:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
joinable!(posts -> sections (section_id));
|
2021-12-23 23:28:26 +01:00
|
|
|
joinable!(tags -> posts (post_id));
|
2021-12-23 16:28:43 +01:00
|
|
|
joinable!(versions -> posts (post_id));
|
2021-11-23 17:49:31 +01:00
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
|
|
|
posts,
|
|
|
|
sections,
|
2021-12-23 23:28:26 +01:00
|
|
|
tags,
|
2021-12-23 16:28:43 +01:00
|
|
|
versions,
|
2021-11-23 17:49:31 +01:00
|
|
|
);
|