From 28b10587520fd139f2306cf8b404a6473b7786dd Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Fri, 4 Nov 2022 11:19:19 +0100 Subject: [PATCH] feat: is_admin column --- entity/src/candidate.rs | 1 + migration/src/m20221024_121621_create_candidate.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/entity/src/candidate.rs b/entity/src/candidate.rs index fe2f725..91e4f6d 100644 --- a/entity/src/candidate.rs +++ b/entity/src/candidate.rs @@ -22,6 +22,7 @@ pub struct Model { pub personal_identification_number_hash: Option, pub public_key: String, pub private_key: String, + pub is_admin: bool, pub created_at: DateTime, pub updated_at: DateTime, } diff --git a/migration/src/m20221024_121621_create_candidate.rs b/migration/src/m20221024_121621_create_candidate.rs index 5483c3a..8743428 100644 --- a/migration/src/m20221024_121621_create_candidate.rs +++ b/migration/src/m20221024_121621_create_candidate.rs @@ -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, }