add new dancer struct
dont want to need to throw strings on the heap to create new dancers in the database
This commit is contained in:
parent
b17c2ac1b0
commit
c0812dd310
1 changed files with 9 additions and 0 deletions
|
@ -30,6 +30,15 @@ pub struct Dancer {
|
|||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Debug)]
|
||||
#[diesel(table_name = crate::schema::dancers)]
|
||||
#[diesel(check_for_backend(diesel::mysql::Mysql))]
|
||||
pub struct NewDancer<'a> {
|
||||
pub id: u32,
|
||||
pub stage_name: &'a str,
|
||||
pub name: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Identifiable, Queryable, Selectable, Debug)]
|
||||
#[diesel(belongs_to(Dancer, foreign_key = dancer))]
|
||||
#[diesel(table_name = crate::schema::shows)]
|
||||
|
|
Loading…
Reference in a new issue