Skip to content

Commit 54b6958

Browse files
committed
Add users.is_admin database column
1 parent febdf7f commit 54b6958

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE users DROP COLUMN is_admin;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE users ADD COLUMN is_admin BOOL DEFAULT false NOT NULL;

src/models/user.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub struct User {
2222
pub gh_id: i32,
2323
pub account_lock_reason: Option<String>,
2424
pub account_lock_until: Option<NaiveDateTime>,
25+
pub is_admin: bool,
2526
}
2627

2728
/// Represents a new user record insertable to the `users` table

src/schema.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,12 @@ diesel::table! {
807807
///
808808
/// (Automatically generated by Diesel.)
809809
account_lock_until -> Nullable<Timestamp>,
810+
/// The `is_admin` column of the `users` table.
811+
///
812+
/// Its SQL type is `Bool`.
813+
///
814+
/// (Automatically generated by Diesel.)
815+
is_admin -> Bool,
810816
}
811817
}
812818

src/worker/jobs/dump_db/dump-db.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ gh_avatar = "public"
185185
gh_id = "public"
186186
account_lock_reason = "private"
187187
account_lock_until = "private"
188+
is_admin = "private"
188189
[users.column_defaults]
189190
gh_access_token = "''"
190191

0 commit comments

Comments
 (0)