From 6bd0f4d2f1baea4fc1941b0b40c057e709a44297 Mon Sep 17 00:00:00 2001 From: Cornelius Suermann Date: Wed, 18 Jan 2023 08:27:45 +0100 Subject: [PATCH 1/2] fix(core): Fix migration (no-changelog) --- .../1673268682475-DeleteExecutionsWithWorkflows.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts b/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts index 6db58e780ad48..573a53f7c8359 100644 --- a/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts +++ b/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts @@ -10,14 +10,18 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte await queryRunner.query(`ALTER TABLE \`${tablePrefix}execution_entity\` MODIFY workflowId INT`); - const workflowIds: Array<{ id: number }> = await queryRunner.query(` - SELECT id FROM \`${tablePrefix}execution_entity\` + const workflowIds: Array<{ workflowId: number }> = await queryRunner.query(` + SELECT workflowId FROM \`${tablePrefix}execution_entity\` `); await queryRunner.query( `DELETE FROM \`${tablePrefix}execution_entity\` WHERE workflowId IS NOT NULL - ${workflowIds.length ? `AND workflowId NOT IN (${workflowIds.map(({ id }) => id).join()})` : ''}`, + ${ + workflowIds.length + ? `AND workflowId NOT IN (${workflowIds.map(({ workflowId }) => workflowId).join()})` + : '' + }`, ); await queryRunner.query( From 0acef7dec8a7c969f72dd3943fa78c6566b19c6a Mon Sep 17 00:00:00 2001 From: Cornelius Suermann Date: Wed, 18 Jan 2023 15:06:02 +0100 Subject: [PATCH 2/2] revert previous fix and apply correct one --- .../1673268682475-DeleteExecutionsWithWorkflows.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts b/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts index 573a53f7c8359..3c34d51c93caf 100644 --- a/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts +++ b/packages/cli/src/databases/migrations/mysqldb/1673268682475-DeleteExecutionsWithWorkflows.ts @@ -10,18 +10,14 @@ export class DeleteExecutionsWithWorkflows1673268682475 implements MigrationInte await queryRunner.query(`ALTER TABLE \`${tablePrefix}execution_entity\` MODIFY workflowId INT`); - const workflowIds: Array<{ workflowId: number }> = await queryRunner.query(` - SELECT workflowId FROM \`${tablePrefix}execution_entity\` + const workflowIds: Array<{ id: number }> = await queryRunner.query(` + SELECT id FROM \`${tablePrefix}workflow_entity\` `); await queryRunner.query( `DELETE FROM \`${tablePrefix}execution_entity\` WHERE workflowId IS NOT NULL - ${ - workflowIds.length - ? `AND workflowId NOT IN (${workflowIds.map(({ workflowId }) => workflowId).join()})` - : '' - }`, + ${workflowIds.length ? `AND workflowId NOT IN (${workflowIds.map(({ id }) => id).join()})` : ''}`, ); await queryRunner.query(