2018-04-08 15:49:19 +02:00
|
|
|
table! {
|
|
|
|
posts (id) {
|
|
|
|
id -> Int4,
|
2018-04-08 18:27:15 +02:00
|
|
|
thread_id -> Int4,
|
2018-04-08 15:49:19 +02:00
|
|
|
body -> Text,
|
|
|
|
posted -> Timestamptz,
|
2018-04-08 22:37:21 +02:00
|
|
|
author_name -> Varchar,
|
|
|
|
author_email -> Varchar,
|
2018-04-08 15:49:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
table! {
|
|
|
|
threads (id) {
|
|
|
|
id -> Int4,
|
|
|
|
title -> Varchar,
|
|
|
|
posted -> Timestamptz,
|
2018-04-08 22:37:21 +02:00
|
|
|
author_name -> Varchar,
|
|
|
|
author_email -> Varchar,
|
2018-04-14 17:47:31 +02:00
|
|
|
sticky -> Bool,
|
2018-04-08 15:49:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-14 17:15:27 +02:00
|
|
|
// Note: Manually inserted as print-schema does not add views.
|
|
|
|
table! {
|
|
|
|
thread_index (thread_id){
|
2018-04-14 20:30:13 +02:00
|
|
|
thread_id -> Int4,
|
2018-04-14 17:15:27 +02:00
|
|
|
title -> Text,
|
2018-04-14 17:47:31 +02:00
|
|
|
thread_author -> Text,
|
|
|
|
created -> Timestamptz,
|
|
|
|
sticky -> Bool,
|
2018-04-14 20:30:13 +02:00
|
|
|
post_id -> Int4,
|
2018-04-14 17:47:31 +02:00
|
|
|
post_author -> Text,
|
|
|
|
posted -> Timestamptz,
|
2018-04-14 17:15:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-08 18:27:15 +02:00
|
|
|
joinable!(posts -> threads (thread_id));
|
2018-04-08 15:49:19 +02:00
|
|
|
|
|
|
|
allow_tables_to_appear_in_same_query!(
|
|
|
|
posts,
|
|
|
|
threads,
|
|
|
|
);
|