about summary refs log tree commit diff
path: root/src/schema.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-08T13·49+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-08T13·49+0200
commit72691c8d6386678be51c71d62e50d168d8fe28bb (patch)
tree83b3066871c4433115de98bef723c09cf359e55c /src/schema.rs
parent042eb88fd74033b9b606189b626f3f0a11a3e2b1 (diff)
feat(models/schema): Map up posts & threads table
Diffstat (limited to 'src/schema.rs')
-rw-r--r--src/schema.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/schema.rs b/src/schema.rs
new file mode 100644
index 000000000000..a899f52ac2cc
--- /dev/null
+++ b/src/schema.rs
@@ -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,
+);