diff --git a/database/migrations/0006-login_users_collation.ts b/database/migrations/0006-login_users_collation.ts index 579bb0a7a..2a730f5e7 100644 --- a/database/migrations/0006-login_users_collation.ts +++ b/database/migrations/0006-login_users_collation.ts @@ -6,11 +6,13 @@ */ export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + // Explicitly change the charset and collate to the one used to then change it + await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;') 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>) { - await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8mb4;') + await queryFn('ALTER TABLE `login_users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;') }