refactor(db): Store thread body in the posts table

This is a simplification over the previous approach. The OP of a
thread is just a normal post like any other in this model, which
allows some code simplifications (and future query convenience).
This commit is contained in:
Vincent Ambo 2018-04-14 16:33:45 +02:00
parent a90d1cc1a4
commit 8c30ef92f6
5 changed files with 36 additions and 23 deletions

View file

@ -5,7 +5,6 @@ use schema::{threads, posts};
pub struct Thread {
pub id: i32,
pub title: String,
pub body: String,
pub posted: DateTime<Utc>,
pub author_name: String,
pub author_email: String,
@ -26,7 +25,6 @@ pub struct Post {
#[table_name="threads"]
pub struct NewThread {
pub title: String,
pub body: String,
pub author_name: String,
pub author_email: String,
}