about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/db.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db.rs b/src/db.rs
index e7af0fdd4eb8..c67eed774594 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -60,12 +60,15 @@ impl Handler<GetThread> for DbExecutor {
 
     fn handle(&mut self, msg: GetThread, _: &mut Self::Context) -> Self::Result {
         use schema::threads::dsl::*;
-
+        use schema::posts::dsl::id;
+        
         let conn = self.0.get()?;
         let thread_result: Thread = threads
             .find(msg.0).first(&conn)?;
 
-        let post_list = Post::belonging_to(&thread_result).load::<Post>(&conn)?;
+        let post_list = Post::belonging_to(&thread_result)
+            .order_by(id.asc())
+            .load::<Post>(&conn)?;
 
         Ok((thread_result, post_list))
     }