Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix account status enum
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jun 9, 2021
1 parent 36a7a21 commit 8d8c526
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/models/enums.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use diesel_derive_enum::DbEnum;

#[derive(Debug, PartialEq, DbEnum, Clone)]
#[DieselType = "AccountStatusEnum"]
#[DbValueStyle = "SCREAMING_SNAKE_CASE"]
pub enum AccountStatus {
CREATED,
Expand Down
4 changes: 2 additions & 2 deletions src/models/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct User {
pub username: String,
pub first_name: String,
pub last_name: String,
pub account_status: String,
pub account_status: AccountStatus,
pub timezone: Option<String>,
pub first_log_in_at: Option<NaiveDateTime>,
pub last_log_in_at: Option<NaiveDateTime>,
Expand All @@ -29,7 +29,7 @@ pub struct NewUser<'a> {
pub username: &'a String,
pub first_name: &'a String,
pub last_name: &'a String,
pub account_status: &'a String,
pub account_status: &'a AccountStatus,
pub timezone: Option<&'a String>,
pub first_log_in_at: Option<&'a NaiveDateTime>,
pub last_log_in_at: Option<&'a NaiveDateTime>,
Expand Down
2 changes: 1 addition & 1 deletion src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ table! {
username -> Varchar,
first_name -> Varchar,
last_name -> Varchar,
account_status -> Varchar,
account_status -> AccountStatusMapping,
timezone -> Nullable<Varchar>,
first_log_in_at -> Nullable<Timestamp>,
last_log_in_at -> Nullable<Timestamp>,
Expand Down

0 comments on commit 8d8c526

Please sign in to comment.