mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -08:00
fix(core): Use table-prefixes in queries in import commands (#5887)
This commit is contained in:
parent
32c4eef574
commit
ddbfcc7d93
|
@ -169,8 +169,9 @@ export class ImportCredentialsCommand extends BaseCommand {
|
||||||
['credentialsId', 'userId'],
|
['credentialsId', 'userId'],
|
||||||
);
|
);
|
||||||
if (config.getEnv('database.type') === 'postgresdb') {
|
if (config.getEnv('database.type') === 'postgresdb') {
|
||||||
|
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||||
await this.transactionManager.query(
|
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))`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,8 +228,9 @@ export class ImportWorkflowsCommand extends BaseCommand {
|
||||||
['workflowId', 'userId'],
|
['workflowId', 'userId'],
|
||||||
);
|
);
|
||||||
if (config.getEnv('database.type') === 'postgresdb') {
|
if (config.getEnv('database.type') === 'postgresdb') {
|
||||||
|
const tablePrefix = config.getEnv('database.tablePrefix');
|
||||||
await this.transactionManager.query(
|
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"))`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue