feat(models/schema): Map up posts & threads table
This commit is contained in:
parent
042eb88fd7
commit
72691c8d63
2 changed files with 40 additions and 0 deletions
16
src/models.rs
Normal file
16
src/models.rs
Normal 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>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue