about summary refs log tree commit diff
path: root/src/models.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/models.rs
parent042eb88fd74033b9b606189b626f3f0a11a3e2b1 (diff)
feat(models/schema): Map up posts & threads table
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
new file mode 100644
index 000000000000..a7ed8a91df03
--- /dev/null
+++ b/src/models.rs
@@ -0,0 +1,16 @@
+use chrono::prelude::{DateTime, Utc};
+
+#[derive(Queryable)]
+pub struct Thread {
+    pub id: i32,
+    pub title: String,
+    pub body: String,
+    pub posted: DateTime<Utc>,
+}
+
+pub struct Post {
+    pub id: i32,
+    pub thread: i32,
+    pub body: String,
+    pub posted: DateTime<Utc>,
+}