feat: is_admin column

This commit is contained in:
Sebastian Pravda 2022-11-04 11:19:19 +01:00
parent 9a422a17cd
commit 28b1058752
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 3 additions and 0 deletions

View file

@ -22,6 +22,7 @@ pub struct Model {
pub personal_identification_number_hash: Option<String>,
pub public_key: String,
pub private_key: String,
pub is_admin: bool,
pub created_at: DateTime,
pub updated_at: DateTime,
}

View file

@ -34,6 +34,7 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Candidate::PersonalIdentificationNumberHash).text())
.col(ColumnDef::new(Candidate::PublicKey).string().not_null())
.col(ColumnDef::new(Candidate::PrivateKey).string().not_null())
.col(ColumnDef::new(Candidate::IsAdmin).boolean().not_null().default(false))
.col(ColumnDef::new(Candidate::CreatedAt).date_time().not_null())
.col(ColumnDef::new(Candidate::UpdatedAt).date_time().not_null())
.to_owned(),
@ -68,6 +69,7 @@ pub enum Candidate {
PersonalIdentificationNumberHash,
PublicKey,
PrivateKey,
IsAdmin,
CreatedAt,
UpdatedAt,
}