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 कारतोफ्फेलस्क्रिप्ट™
parent f0954b94e1
commit de58fb9860
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

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