From 0fbb3f0f026432f1aea87b106a0c1f732f93c792 Mon Sep 17 00:00:00 2001 From: OlegIvaniv Date: Wed, 22 Feb 2023 14:20:06 +0100 Subject: [PATCH] fix(core): Do not remove empty output connections arrays in PurgeInvalidWorkflowConnections migration (#5546) fix(cli): Do not remove empty output connections arrays in PurgeInvalidWorkflowConnections migration --- ...75940580449-PurgeInvalidWorkflowConnections.ts | 15 --------------- ...75940580449-PurgeInvalidWorkflowConnections.ts | 15 --------------- ...75940580449-PurgeInvalidWorkflowConnections.ts | 15 --------------- 3 files changed, 45 deletions(-) diff --git a/packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts b/packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts index 2a805d0917198..5acf8c8b264f4 100644 --- a/packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts +++ b/packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts @@ -58,22 +58,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn !nodesThatCannotReceiveInput.includes(outgoingConnections.node), ); }); - - // Filter out output connection items that are empty - connection[outputConnectionName] = connection[outputConnectionName].filter( - (item) => item.length > 0, - ); - - // Delete the output connection container if it is empty - if (connection[outputConnectionName].length === 0) { - delete connection[outputConnectionName]; - } }); - - // Finally delete the source node if it has no output connections - if (Object.keys(connection).length === 0) { - delete connections[sourceNodeName]; - } }); // Update database with new connections diff --git a/packages/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts b/packages/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts index 8a87ef8919e06..1da69497e765c 100644 --- a/packages/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts +++ b/packages/cli/src/databases/migrations/postgresdb/1675940580449-PurgeInvalidWorkflowConnections.ts @@ -50,22 +50,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn !nodesThatCannotReceiveInput.includes(outgoingConnections.node), ); }); - - // Filter out output connection items that are empty - connection[outputConnectionName] = connection[outputConnectionName].filter( - (item) => item.length > 0, - ); - - // Delete the output connection container if it is empty - if (connection[outputConnectionName].length === 0) { - delete connection[outputConnectionName]; - } }); - - // Finally delete the source node if it has no output connections - if (Object.keys(connection).length === 0) { - delete connections[sourceNodeName]; - } }); // Update database with new connections diff --git a/packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts b/packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts index fe03f3ccaea6b..8207f2c8f3f2d 100644 --- a/packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts +++ b/packages/cli/src/databases/migrations/sqlite/1675940580449-PurgeInvalidWorkflowConnections.ts @@ -51,22 +51,7 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn !nodesThatCannotReceiveInput.includes(outgoingConnections.node), ); }); - - // Filter out output connection items that are empty - connection[outputConnectionName] = connection[outputConnectionName].filter( - (item) => item.length > 0, - ); - - // Delete the output connection container if it is empty - if (connection[outputConnectionName].length === 0) { - delete connection[outputConnectionName]; - } }); - - // Finally delete the source node if it has no output connections - if (Object.keys(connection).length === 0) { - delete connections[sourceNodeName]; - } }); // Update database with new connections