adding query structs for dancer and shows
This commit is contained in:
parent
d290ccf8d0
commit
b17c2ac1b0
1 changed files with 20 additions and 0 deletions
|
@ -21,6 +21,26 @@ pub struct Drink {
|
||||||
pub time: chrono::NaiveDateTime,
|
pub time: chrono::NaiveDateTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Identifiable, Queryable, Selectable, Debug)]
|
||||||
|
#[diesel(table_name = crate::schema::dancers)]
|
||||||
|
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
||||||
|
pub struct Dancer {
|
||||||
|
pub id: u32,
|
||||||
|
pub stage_name: String,
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Identifiable, Queryable, Selectable, Debug)]
|
||||||
|
#[diesel(belongs_to(Dancer, foreign_key = dancer))]
|
||||||
|
#[diesel(table_name = crate::schema::shows)]
|
||||||
|
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
||||||
|
pub struct Show {
|
||||||
|
pub id: u32,
|
||||||
|
pub dancer: u32,
|
||||||
|
pub start: chrono::NaiveDateTime,
|
||||||
|
pub end: Option<chrono::NaiveDateTime>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Insertable, Debug)]
|
#[derive(Insertable, Debug)]
|
||||||
#[diesel(table_name = crate::schema::drinks)]
|
#[diesel(table_name = crate::schema::drinks)]
|
||||||
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
||||||
|
|
Loading…
Reference in a new issue