feat(models/schema): Map up posts & threads table

This commit is contained in:
Vincent Ambo 2018-04-08 15:49:19 +02:00
parent 042eb88fd7
commit 72691c8d63
2 changed files with 40 additions and 0 deletions

16
src/models.rs Normal file
View file

@ -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>,
}