mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
migration to convert all emails to lowercase
This commit is contained in:
parent
a837fd5f60
commit
7af33a5c9f
16
database/migrations/0025-emails_to_lower.ts
Normal file
16
database/migrations/0025-emails_to_lower.ts
Normal file
@ -0,0 +1,16 @@
|
||||
/* MIGRATION TO MAKE ALL EMAILS LOWERCASE
|
||||
*
|
||||
* Make all `email` values in `users` lowercase.
|
||||
* This allows safe queries without any modificators
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('UPDATE `users` SET `email` = LOWER(`email`);')
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
// This migration cannot be revered
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user