-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[change] move todo models to another module
- Loading branch information
Showing
4 changed files
with
26 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
use diesel::{Insertable, Queryable}; | ||
|
||
use crate::schema::todos; | ||
|
||
#[derive(Queryable, Debug)] | ||
pub struct Todo { | ||
pub channel_id: i64, | ||
pub id: i32, | ||
pub todo: String, | ||
pub creation_date: String, | ||
pub completion_date: Option<String>, | ||
pub assignee: Option<i64>, | ||
} | ||
|
||
#[derive(Insertable)] | ||
#[diesel(table_name = todos)] | ||
pub struct NewTodo<'a> { | ||
pub channel_id: &'a i64, | ||
pub id: &'a i32, | ||
pub todo: &'a str, | ||
pub creation_date: &'a str, | ||
pub assignee: Option<i64>, | ||
} | ||
pub mod todo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use diesel::{Insertable, Queryable}; | ||
|
||
use crate::schema::todos; | ||
|
||
#[derive(Queryable, Debug)] | ||
pub struct Todo { | ||
pub channel_id: i64, | ||
pub id: i32, | ||
pub todo: String, | ||
pub creation_date: String, | ||
pub completion_date: Option<String>, | ||
pub assignee: Option<i64>, | ||
} | ||
|
||
#[derive(Insertable)] | ||
#[diesel(table_name = todos)] | ||
pub struct NewTodo<'a> { | ||
pub channel_id: &'a i64, | ||
pub id: &'a i32, | ||
pub todo: &'a str, | ||
pub creation_date: &'a str, | ||
pub assignee: Option<i64>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters