diff --git a/src/models/enums.rs b/src/models/enums.rs index ec2d3be..1e46cae 100644 --- a/src/models/enums.rs +++ b/src/models/enums.rs @@ -1,7 +1,6 @@ use diesel_derive_enum::DbEnum; #[derive(Debug, PartialEq, DbEnum, Clone)] -#[DieselType = "AccountStatusEnum"] #[DbValueStyle = "SCREAMING_SNAKE_CASE"] pub enum AccountStatus { CREATED, diff --git a/src/models/user.rs b/src/models/user.rs index d6df1ab..7621b41 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -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, pub first_log_in_at: Option, pub last_log_in_at: Option, @@ -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>, diff --git a/src/schema.rs b/src/schema.rs index d727291..ac9656d 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -9,7 +9,7 @@ table! { username -> Varchar, first_name -> Varchar, last_name -> Varchar, - account_status -> Varchar, + account_status -> AccountStatusMapping, timezone -> Nullable, first_log_in_at -> Nullable, last_log_in_at -> Nullable,