use crate::schema::*;
#[derive(Queryable)]
pub struct User {
pub username: String,
pub password: String,
pub email: String,
pub first_name: String,
pub last_name: String,
pub photo_url: Option<String>,
pub is_admin: bool,
}
#[derive(Insertable)]
#[table_name = "users"]
pub struct NewUser<'a> {
pub username: &'a str,
pub password: &'a str,
pub email: &'a str,
pub first_name: &'a str,
pub last_name: &'a str,
pub is_admin: bool,
}
#[derive(Deserialize, AsChangeset, Default, Clone)]
#[table_name = "users"]
pub struct UpdateUserData {
pub password: Option<String>,
pub email: Option<String>,
pub first_name: Option<String>,
pub last_name: Option<String>,
}