From d255b094dd30d15dbce44de840ae924fb212a77a 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: Thu, 22 Jun 2023 16:54:05 +0200 Subject: [PATCH] fix(core): Fix `import:credential` on postgres (no-changelog) (#6515) Since we switched to string ids, we don't need to update the `_seq` values for postgres. We removed this bit for the `import:workflow` [here](https://github.com/n8n-io/n8n/pull/6345/files#diff-ff45b1d8db8d3dc67d19aa34e4d066e4156ddcd311c0b8d75a3d082009065197L230), but missed updating this file. --- packages/cli/src/commands/import/credentials.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/cli/src/commands/import/credentials.ts b/packages/cli/src/commands/import/credentials.ts index 27af3b12b..4975cb66d 100644 --- a/packages/cli/src/commands/import/credentials.ts +++ b/packages/cli/src/commands/import/credentials.ts @@ -4,7 +4,6 @@ import fs from 'fs'; import glob from 'fast-glob'; import { Container } from 'typedi'; import type { EntityManager } from 'typeorm'; -import config from '@/config'; import * as Db from '@/Db'; import type { User } from '@db/entities/User'; import { SharedCredentials } from '@db/entities/SharedCredentials'; @@ -168,12 +167,6 @@ 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('${tablePrefix}credentials_entity_id_seq', (SELECT MAX(id) from ${tablePrefix}credentials_entity))`, - ); - } } private async getOwner() {