File tree Expand file tree Collapse file tree 5 files changed +12
-0
lines changed
crates_io_database_dump/src
migrations/2025-07-16-123330_add_gh_encrypted_token Expand file tree Collapse file tree 5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ pub struct User {
23
23
#[ diesel( deserialize_as = String ) ]
24
24
#[ serde( skip) ]
25
25
pub gh_access_token : SecretString ,
26
+ #[ serde( skip) ]
27
+ pub gh_encrypted_token : Option < Vec < u8 > > ,
26
28
pub account_lock_reason : Option < String > ,
27
29
pub account_lock_until : Option < DateTime < Utc > > ,
28
30
pub is_admin : bool ,
@@ -94,6 +96,7 @@ pub struct NewUser<'a> {
94
96
pub name : Option < & ' a str > ,
95
97
pub gh_avatar : Option < & ' a str > ,
96
98
pub gh_access_token : & ' a str ,
99
+ pub gh_encrypted_token : Option < & ' a [ u8 ] > ,
97
100
}
98
101
99
102
impl NewUser < ' _ > {
@@ -125,6 +128,7 @@ impl NewUser<'_> {
125
128
users:: name. eq ( excluded ( users:: name) ) ,
126
129
users:: gh_avatar. eq ( excluded ( users:: gh_avatar) ) ,
127
130
users:: gh_access_token. eq ( excluded ( users:: gh_access_token) ) ,
131
+ users:: gh_encrypted_token. eq ( excluded ( users:: gh_encrypted_token) ) ,
128
132
) )
129
133
. returning ( User :: as_returning ( ) )
130
134
. get_result ( conn)
Original file line number Diff line number Diff line change @@ -880,6 +880,8 @@ diesel::table! {
880
880
is_admin -> Bool ,
881
881
/// Whether or not the user wants to receive notifications when a package they own is published
882
882
publish_notifications -> Bool ,
883
+ /// Encrypted GitHub access token
884
+ gh_encrypted_token -> Nullable <Bytea >,
883
885
}
884
886
}
885
887
Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ account_lock_reason = "private"
232
232
account_lock_until = " private"
233
233
is_admin = " private"
234
234
publish_notifications = " private"
235
+ gh_encrypted_token = " private"
235
236
[users .column_defaults ]
236
237
gh_access_token = " ''"
237
238
Original file line number Diff line number Diff line change
1
+ alter table users drop column gh_encrypted_token;
Original file line number Diff line number Diff line change
1
+ alter table users
2
+ add column gh_encrypted_token bytea ;
3
+
4
+ comment on column users.gh_encrypted_token is ' Encrypted GitHub access token' ;
You can’t perform that action at this time.
0 commit comments