From 622744a93ac226250475d66e1ae799962c29bbfe Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 4 Jan 2024 13:19:22 +0000 Subject: [PATCH] feat: duplicate column support --- .../jobs/jobs/export-import/import.service.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts index 6d62efa5cc..4f9b49fa56 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts @@ -766,6 +766,8 @@ export class ImportService { a.uidt === UITypes.Rollup || a.uidt === UITypes.Formula || a.uidt === UITypes.QrCode || + a.uidt === UITypes.CreateTime || + a.uidt === UITypes.LastModifiedTime || a.uidt === UITypes.Barcode, ), ); @@ -886,6 +888,26 @@ export class ImportService { user: param.user, }); + for (const nColumn of freshModelData.columns) { + if (nColumn.title === col.title) { + idMap.set(col.id, nColumn.id); + break; + } + } + } else if ( + col.uidt === UITypes.CreateTime || + col.uidt === UITypes.LastModifiedTime + ) { + const freshModelData = await this.columnsService.columnAdd({ + tableId: getIdOrExternalId(getParentIdentifier(col.id)), + column: withoutId({ + ...flatCol, + system: false, + }) as any, + req: param.req, + user: param.user, + }); + for (const nColumn of freshModelData.columns) { if (nColumn.title === col.title) { idMap.set(col.id, nColumn.id);