mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
fix(core): Fix AddActivatedAtUserSetting migration on MariaDB (#9910)
This commit is contained in:
parent
abb74587db
commit
db29e84666
|
@ -5,7 +5,7 @@ export class AddActivatedAtUserSetting1717498465931 implements ReversibleMigrati
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`UPDATE ${escape.tableName('user')}
|
`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`,
|
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) {
|
async down({ queryRunner, escape }: MigrationContext) {
|
||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`UPDATE ${escape.tableName('user')}
|
`UPDATE ${escape.tableName('user')}
|
||||||
SET settings = JSON_REMOVE(CAST(settings AS JSON), '$.userActivatedAt')
|
SET settings = JSON_REMOVE(settings, '$.userActivatedAt')
|
||||||
WHERE settings IS NOT NULL`,
|
WHERE settings IS NOT NULL`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue