From ddbfcc7d93cc3645fc3bb0f0de059ac76adaa475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 3 Apr 2023 14:32:49 +0200 Subject: [PATCH] fix(core): Use table-prefixes in queries in import commands (#5887) --- packages/cli/src/commands/import/credentials.ts | 3 ++- packages/cli/src/commands/import/workflow.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/import/credentials.ts b/packages/cli/src/commands/import/credentials.ts index efed0a972c..985c70fe89 100644 --- a/packages/cli/src/commands/import/credentials.ts +++ b/packages/cli/src/commands/import/credentials.ts @@ -169,8 +169,9 @@ export class ImportCredentialsCommand extends BaseCommand { ['credentialsId', 'userId'], ); if (config.getEnv('database.type') === 'postgresdb') { + const tablePrefix = config.getEnv('database.tablePrefix'); await this.transactionManager.query( - "SELECT setval('credentials_entity_id_seq', (SELECT MAX(id) from credentials_entity))", + `SELECT setval('${tablePrefix}credentials_entity_id_seq', (SELECT MAX(id) from ${tablePrefix}credentials_entity))`, ); } } diff --git a/packages/cli/src/commands/import/workflow.ts b/packages/cli/src/commands/import/workflow.ts index c6774b60a9..9634911273 100644 --- a/packages/cli/src/commands/import/workflow.ts +++ b/packages/cli/src/commands/import/workflow.ts @@ -228,8 +228,9 @@ export class ImportWorkflowsCommand extends BaseCommand { ['workflowId', 'userId'], ); if (config.getEnv('database.type') === 'postgresdb') { + const tablePrefix = config.getEnv('database.tablePrefix'); await this.transactionManager.query( - "SELECT setval('workflow_entity_id_seq', (SELECT MAX(id) from workflow_entity))", + `SELECT setval('${tablePrefix}workflow_entity_id_seq', (SELECT MAX(id) from "${tablePrefix}workflow_entity"))`, ); } }