Add admin column to users table
This commit is contained in:
@ -41,6 +41,8 @@ pub struct User {
|
||||
/// The time the user was created
|
||||
#[cfg_attr(feature = "ssr", diesel(deserialize_as = SystemTime))]
|
||||
pub created_at: Option<SystemTime>,
|
||||
/// Whether the user is an admin
|
||||
pub admin: bool,
|
||||
}
|
||||
|
||||
/// Model for an artist
|
||||
|
@ -25,6 +25,7 @@ pub fn Signup() -> impl IntoView {
|
||||
email: email.get(),
|
||||
password: Some(password.get()),
|
||||
created_at: None,
|
||||
admin: false,
|
||||
};
|
||||
log!("new user: {:?}", new_user);
|
||||
|
||||
|
@ -50,6 +50,7 @@ diesel::table! {
|
||||
email -> Varchar,
|
||||
password -> Varchar,
|
||||
created_at -> Timestamp,
|
||||
admin -> Bool,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user