mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
added migration 0006-login_users_collation
This commit is contained in:
parent
e7b2184a95
commit
0b0af7ae76
17
database/migrations/0006-login_users_collation.ts
Normal file
17
database/migrations/0006-login_users_collation.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/* MIGRATION TO ALIGN COLLATIONS
|
||||
*
|
||||
* in oder to be able to compare `login_users` with `state_users`
|
||||
* when the databases default is not `utf8mb4_unicode_ci`, we need
|
||||
* to also explicitly define it in the table
|
||||
*
|
||||
*/
|
||||
|
||||
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn(
|
||||
'ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;',
|
||||
)
|
||||
}
|
||||
|
||||
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
|
||||
await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8mb4;')
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user