mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
cleanup migration 12 - passphrase change
This commit is contained in:
parent
832533fb4c
commit
75ca456293
@ -46,9 +46,6 @@ const detectMnemonic = (passphrase: string[]): string[] => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||||
// Delete data with no reference in login_users table
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
// 663 affected rows
|
|
||||||
const userBackups = await queryFn(`SELECT * FROM login_user_backups`)
|
const userBackups = await queryFn(`SELECT * FROM login_user_backups`)
|
||||||
let i = 0
|
let i = 0
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
@ -62,19 +59,9 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis
|
|||||||
)
|
)
|
||||||
i++
|
i++
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(
|
console.log(`Updated passphrase of user ${userBackup.user_id}`)
|
||||||
'Changed passphrase mnemonic type',
|
|
||||||
i,
|
|
||||||
`"${userBackup.passphrase}"`,
|
|
||||||
'TO',
|
|
||||||
`"${newPassphrase}"`,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// Searching for users with a missing password and a backup entry
|
|
||||||
// `SELECT * FROM login_user_backups WHERE user_id IN (SELECT id FROM login_users WHERE password = 0)`
|
|
||||||
// results in only new users with the proper passphrase scheme - luckily we seem to be good on this one
|
|
||||||
// 142 entries in total are found and every entry has type 2 (new one).
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user