From db29e84666b814fd4710dc3ade6e53304216fad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 2 Jul 2024 15:25:49 +0200 Subject: [PATCH] fix(core): Fix AddActivatedAtUserSetting migration on MariaDB (#9910) --- .../mysqldb/1717498465931-AddActivatedAtUserSetting.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.ts b/packages/cli/src/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.ts index e7adda5d94..23fb794847 100644 --- a/packages/cli/src/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.ts +++ b/packages/cli/src/databases/migrations/mysqldb/1717498465931-AddActivatedAtUserSetting.ts @@ -5,7 +5,7 @@ export class AddActivatedAtUserSetting1717498465931 implements ReversibleMigrati const now = Date.now(); await queryRunner.query( `UPDATE ${escape.tableName('user')} - SET settings = JSON_SET(COALESCE(settings, '{}'), '$.userActivatedAt', CAST('${now}' AS JSON)) + SET settings = JSON_SET(COALESCE(settings, '{}'), '$.userActivatedAt', '${now}') WHERE settings IS NOT NULL AND JSON_EXTRACT(settings, '$.userActivated') = true`, ); } @@ -13,7 +13,7 @@ export class AddActivatedAtUserSetting1717498465931 implements ReversibleMigrati async down({ queryRunner, escape }: MigrationContext) { await queryRunner.query( `UPDATE ${escape.tableName('user')} - SET settings = JSON_REMOVE(CAST(settings AS JSON), '$.userActivatedAt') + SET settings = JSON_REMOVE(settings, '$.userActivatedAt') WHERE settings IS NOT NULL`, ); }