fix(core): Use table-prefixes in queries in import commands (#5887)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-04-03 14:32:49 +02:00
committed by GitHub
parent 32c4eef574
commit ddbfcc7d93
2 changed files with 4 additions and 2 deletions

View File

@@ -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))`,
);
}
}

View File

@@ -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"))`,
);
}
}