File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,6 @@ export async function advisor(): Promise<void> {
8282 return res [ "count(*)" ] as number ;
8383 }
8484
85- const adminUsers = await count (
86- synapse . count ( "*" ) . from < SUser > ( "users" ) . where ( { admin : 1 } ) ,
87- ) ;
88- if ( adminUsers > 0 ) {
89- warn (
90- `Synapse database contains ${ adminUsers } admin users which will need to be added to the MAS configuration.` ,
91- ) ;
92- }
93-
9485 const guestUsers = await count (
9586 synapse . count ( "*" ) . from < SUser > ( "users" ) . where ( { is_guest : 1 } ) ,
9687 ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import type { MCompatRefreshToken } from "./types/MCompatRefreshToken.d.ts";
1919import type { MCompatSession } from "./types/MCompatSession.d.ts" ;
2020import type { MUpstreamOauthLink } from "./types/MUpstreamOauthLink.d.ts" ;
2121import type { MUpstreamOauthProvider } from "./types/MUpstreamOauthProvider.d.ts" ;
22+ import type { MUser } from "./types/MUser.js" ;
2223import type { MUserEmail } from "./types/MUserEmail.d.ts" ;
2324import type { MUserPassword } from "./types/MUserPassword.d.ts" ;
2425import type { SAccessToken } from "./types/SAccessToken.d.ts" ;
@@ -207,11 +208,13 @@ export async function migrate(): Promise<void> {
207208 const userCreatedAt = new Date (
208209 Number . parseInt ( `${ user . creation_ts } ` ) * 1000 ,
209210 ) ;
210- const masUser = {
211+ const masUser : MUser = {
211212 user_id : makeUuid ( userCreatedAt ) ,
212213 username : localpart ,
213214 created_at : userCreatedAt ,
214215 locked_at : user . deactivated === 1 ? userCreatedAt : null ,
216+ primary_user_email_id : null ,
217+ can_request_admin : user . admin === 1 ,
215218 } ;
216219 executions . push ( ( ) => mas . insert ( masUser ) . into ( "users" ) ) ;
217220 log . debug ( `${ stringifyAndRedact ( user ) } => ${ stringifyAndRedact ( masUser ) } ` ) ;
Original file line number Diff line number Diff line change @@ -12,5 +12,7 @@ export interface MUser {
1212 user_id : UUID < MUser > ;
1313 username : string ; // localpart only without @
1414 created_at : Date ;
15- primary_user_email_id ?: UUID < MUserEmail > ;
15+ locked_at : Date | null ;
16+ primary_user_email_id : UUID < MUserEmail > | null ;
17+ can_request_admin : boolean ;
1618}
You can’t perform that action at this time.
0 commit comments