mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
plug holes in login_users
This commit is contained in:
parent
eb33e5130a
commit
163570d34f
17
database/migrations/0009-login_users_plug_holes.ts
Normal file
17
database/migrations/0009-login_users_plug_holes.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/* MIGRATION TO CLEAN PRODUCTION DATA
|
||||
*
|
||||
* some entries in the login_users table are inconsistent.
|
||||
* As solution the inconsistent data is purged and the corresponding
|
||||
* account is set as not yet activated
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
// Remove incomplete data and set account as not activated yet.
|
||||
await queryFn(
|
||||
`UPDATE login_users SET password = 0, pubkey = NULL, email_checked = 0 WHERE privkey IS NULL;`,
|
||||
)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
return [] // cannot undelete things
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user