From 96b0cae268adc5b42537701f066c06f94ec1cf31 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sat, 7 Oct 2023 12:48:07 +0600 Subject: [PATCH] Fix bad estimation migration (#3808) Signed-off-by: Denis Bykhov --- models/tracker/src/migration.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/tracker/src/migration.ts b/models/tracker/src/migration.ts index 1fcf7e62c6..72944a0344 100644 --- a/models/tracker/src/migration.ts +++ b/models/tracker/src/migration.ts @@ -144,7 +144,7 @@ async function fixEstimation (client: MigrationClient): Promise { for (const child of childInfo ?? []) { child.estimation = child.estimation * 8 } - await client.update(DOMAIN_TASK, { _id: issue._id }, { reportedTime: issue.estimation * 8, childInfo }) + await client.update(DOMAIN_TASK, { _id: issue._id }, { estimation: issue.estimation * 8, childInfo }) } const createTxes = await client.find>(DOMAIN_TX, { 'tx.objectClass': tracker.class.Issue, @@ -166,7 +166,7 @@ async function fixEstimation (client: MigrationClient): Promise { for (const tx of updateTxes) { const val = (tx.tx as TxUpdateDoc).operations.estimation if (val !== undefined) { - await client.update(DOMAIN_TX, { _id: tx._id }, { 'tx.operations.value': val * 8 }) + await client.update(DOMAIN_TX, { _id: tx._id }, { 'tx.operations.estimation': val * 8 }) } } }