Create artist model

This commit is contained in:
Ethan Girouard 2024-02-08 18:40:02 -05:00
parent 319958f264
commit 79add82c2d
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146

View File

@ -43,3 +43,16 @@ pub struct NewUser {
/// The user's password, stored as a hash /// The user's password, stored as a hash
pub password: String, pub password: String,
} }
/// Model for an artist
#[cfg_attr(feature = "ssr", derive(Queryable, Selectable, Insertable))]
#[cfg_attr(feature = "ssr", diesel(table_name = crate::schema::artists))]
#[cfg_attr(feature = "ssr", diesel(check_for_backend(diesel::pg::Pg)))]
pub struct Artist {
/// A unique id for the artist
#[cfg_attr(feature = "ssr", diesel(deserialize_as = i32))]
pub id: Option<i32>,
/// The artist's name
pub name: String,
}