backend: add admin flag
This commit is contained in:
parent
359bfc5ced
commit
4c30cd201e
3 changed files with 13 additions and 2 deletions
|
@ -19,6 +19,7 @@ pub struct Model {
|
|||
pub name: String,
|
||||
pub email: String,
|
||||
pub hash: String,
|
||||
pub admin: bool,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
|
||||
|
@ -27,6 +28,7 @@ pub enum Column {
|
|||
Name,
|
||||
Email,
|
||||
Hash,
|
||||
Admin,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
|
||||
|
@ -52,6 +54,7 @@ impl ColumnTrait for Column {
|
|||
Self::Name => ColumnType::String(None).def(),
|
||||
Self::Email => ColumnType::String(None).def().unique(),
|
||||
Self::Hash => ColumnType::String(None).def(),
|
||||
Self::Admin => ColumnType::Boolean.def(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue