adding query structs for dancer and shows
parent
d290ccf8d0
commit
b17c2ac1b0
|
@ -21,6 +21,26 @@ pub struct Drink {
|
|||
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)]
|
||||
#[diesel(table_name = crate::schema::drinks)]
|
||||
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
||||
|
|
Loading…
Reference in New Issue