fix(core): Fix named parameter resolution in migrations (#7688)

Fixes #7628
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-15 10:31:08 +01:00
committed by GitHub
parent 91c3ea87fe
commit 4441ed5116
7 changed files with 37 additions and 56 deletions

View File

@@ -18,11 +18,10 @@ export class AddNodeIds1658930531669 implements ReversibleMigration {
}
});
await runQuery(
`UPDATE ${tableName} SET nodes = :nodes WHERE id = :id`,
{ nodes: JSON.stringify(nodes) },
{ id: workflow.id },
);
await runQuery(`UPDATE ${tableName} SET nodes = :nodes WHERE id = :id`, {
nodes: JSON.stringify(nodes),
id: workflow.id,
});
});
});
}
@@ -33,11 +32,10 @@ export class AddNodeIds1658930531669 implements ReversibleMigration {
await runInBatches<Workflow>(workflowsQuery, async (workflows) => {
workflows.forEach(async (workflow) => {
const nodes = parseJson(workflow.nodes).map(({ id, ...rest }) => rest);
await runQuery(
`UPDATE ${tableName} SET nodes = :nodes WHERE id = :id`,
{ nodes: JSON.stringify(nodes) },
{ id: workflow.id },
);
await runQuery(`UPDATE ${tableName} SET nodes = :nodes WHERE id = :id`, {
nodes: JSON.stringify(nodes),
id: workflow.id,
});
});
});
}