From 115f50ae37338450c3533f403a8404a84cfb8670 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 8 Apr 2018 22:37:21 +0200 Subject: [PATCH] chore(models/schema): Update with author fields --- src/models.rs | 4 ++++ src/schema.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/models.rs b/src/models.rs index 28b1caa7c..daeccf852 100644 --- a/src/models.rs +++ b/src/models.rs @@ -7,6 +7,8 @@ pub struct Thread { pub title: String, pub body: String, pub posted: DateTime, + pub author_name: String, + pub author_email: String, } #[derive(Identifiable, Queryable, Serialize, Associations)] @@ -16,6 +18,8 @@ pub struct Post { pub thread_id: i32, pub body: String, pub posted: DateTime, + pub author_name: String, + pub author_email: String, } #[derive(Deserialize, Insertable)] diff --git a/src/schema.rs b/src/schema.rs index 8b05eb546..4881056c1 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -4,6 +4,8 @@ table! { thread_id -> Int4, body -> Text, posted -> Timestamptz, + author_name -> Varchar, + author_email -> Varchar, } } @@ -13,6 +15,8 @@ table! { title -> Varchar, body -> Text, posted -> Timestamptz, + author_name -> Varchar, + author_email -> Varchar, } }