From 60f8ab8fbe70580206313969d22518fdf0844448 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 6 May 2023 04:15:34 +0300 Subject: [PATCH] fix: add external primary keys to idMap Signed-off-by: mertmit --- .../src/modules/jobs/export-import/duplicate.processor.ts | 1 - .../src/modules/jobs/export-import/import.service.ts | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts b/packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts index 55d812ce8c..785355453b 100644 --- a/packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts +++ b/packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts @@ -536,7 +536,6 @@ export class DuplicateProcessor { }, complete: async () => { if (chunk.length > 0) { - console.log('chunk', chunk); try { await this.bulkDataService.bulkDataUpdate({ projectName: destProject.id, diff --git a/packages/nocodb/src/modules/jobs/export-import/import.service.ts b/packages/nocodb/src/modules/jobs/export-import/import.service.ts index 0052a8b22c..90e15f9be0 100644 --- a/packages/nocodb/src/modules/jobs/export-import/import.service.ts +++ b/packages/nocodb/src/modules/jobs/export-import/import.service.ts @@ -86,6 +86,14 @@ export class ImportService { await model.getColumns(); + const primaryKey = model.primaryKey; + if (primaryKey) { + idMap.set( + `${model.project_id}::${model.base_id}::${model.id}::${primaryKey.id}`, + primaryKey.id, + ); + } + for (const col of model.columns) { externalIdMap.set(`${idMap.get(model.id)}::${col.id}`, col.id); }