fix(plugin-workflow-manual): fix task migration (#6407)

This commit is contained in:
Junyi 2025-03-11 00:00:28 +08:00 committed by GitHub
parent ded7b983fb
commit 6d929de82e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,17 +26,17 @@ export default class extends Migration {
}, },
transaction, transaction,
}); });
await WorkflowTaskModel.bulkCreate( const records = tasks.map((item) => ({
tasks.map((item) => ({ type: MANUAL_TASK_TYPE,
type: MANUAL_TASK_TYPE, key: `${item.id}`,
key: `${item.id}`, userId: item.userId,
userId: item.userId, workflowId: item.workflowId,
workflowId: item.workflowId, }));
})), for (const record of records) {
{ await WorkflowTaskModel.upsert(record, {
transaction, transaction,
}, });
); }
}); });
} }
} }