about summary refs log tree commit diff
path: root/src/models.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-14T15·47+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-14T15·47+0200
commitd1c45159b9bb23553768b06ce7ad97ec38e8b845 (patch)
treef6dae457fddcb75bb6a3c65eec699868beb3b89f /src/models.rs
parentc136d34e798f399c515b31d90fd1194b02005c96 (diff)
feat(db): Add support for stickies in database
Adds a 'sticky' column to threads and rewrites the thread index to
take sticky markings into account when ordering threads.

Stickies are not yet highlighted in any way in the forum overview.
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/models.rs b/src/models.rs
index 159a85469aeb..9d3405e1540f 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -24,6 +24,7 @@ pub struct Thread {
     pub posted: DateTime<Utc>,
     pub author_name: String,
     pub author_email: String,
+    pub sticky: bool,
 }
 
 /// This struct is used as the query type for the thread index view,
@@ -33,9 +34,12 @@ pub struct Thread {
 pub struct ThreadIndex {
     pub thread_id: i32,
     pub title: String,
-    pub author_name: String,
-    pub posted: DateTime<Utc>,
+    pub thread_author: String,
+    pub created: DateTime<Utc>,
+    pub sticky: bool,
     pub post_id: i32,
+    pub post_author: String,
+    pub posted: DateTime<Utc>,
 }
 
 #[derive(Identifiable, Queryable, Serialize, Associations)]