From 7dd63873e4b164f482777f519c627eba55dff65b Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Tue, 27 Aug 2024 15:33:24 +0700 Subject: [PATCH] fix: migrate collaborative markup in activity (#6400) Signed-off-by: Alexander Onnikov --- models/activity/src/migration.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/models/activity/src/migration.ts b/models/activity/src/migration.ts index 374ea40215..f504257d63 100644 --- a/models/activity/src/migration.ts +++ b/models/activity/src/migration.ts @@ -175,6 +175,17 @@ export async function migrateMessagesSpace ( } } +async function migrateActivityMarkup (client: MigrationClient): Promise { + await client.update( + DOMAIN_ACTIVITY, + { + _class: activity.class.DocUpdateMessage, + 'attributeUpdates.attrClass': 'core:class:TypeCollaborativeMarkup' + }, + { 'attributeUpdates.attrClass': core.class.TypeMarkup } + ) +} + export const activityOperation: MigrateOperation = { async migrate (client: MigrationClient): Promise { await tryMigrate(client, activityId, [ @@ -206,6 +217,10 @@ export const activityOperation: MigrateOperation = { { space: contact.space.Contacts } ) } + }, + { + state: 'migrate-activity-markup', + func: migrateActivityMarkup } ]) },