feat(models/schema): Map up posts & threads table

This commit is contained in:
Vincent Ambo 2018-04-08 15:49:19 +02:00
parent 042eb88fd7
commit 72691c8d63
2 changed files with 40 additions and 0 deletions

24
src/schema.rs Normal file
View file

@ -0,0 +1,24 @@
table! {
posts (id) {
id -> Int4,
thread -> Int4,
body -> Text,
posted -> Timestamptz,
}
}
table! {
threads (id) {
id -> Int4,
title -> Varchar,
body -> Text,
posted -> Timestamptz,
}
}
joinable!(posts -> threads (thread));
allow_tables_to_appear_in_same_query!(
posts,
threads,
);