From 754ad6e3a7ce69d9f38bc511ff3e6c131eb996a5 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Fri, 13 Jun 2025 20:34:00 +0400 Subject: [PATCH] eqms-1582: fix roles migration (#9230) Signed-off-by: Alexey Zinoviev --- models/core/src/migration.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/core/src/migration.ts b/models/core/src/migration.ts index 1b7eccc7d1..dda334462c 100644 --- a/models/core/src/migration.ts +++ b/models/core/src/migration.ts @@ -542,9 +542,10 @@ async function migrateAccounts (client: MigrationClient): Promise { accountUuidBySocialKey ) - update[`${type.targetClass}`] = { - [role._id]: newAssignees + if (update[`${type.targetClass}`] == null) { + update[`${type.targetClass}`] = {} } + update[`${type.targetClass}`][role._id] = newAssignees } } }