diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts index 03a49ffff6..42e54df39a 100644 --- a/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts +++ b/packages/nocodb/src/modules/jobs/jobs/export-import/duplicate.processor.ts @@ -2,8 +2,8 @@ import { Readable } from 'stream'; import { Process, Processor } from '@nestjs/bull'; import { Job } from 'bull'; import papaparse from 'papaparse'; -import { UITypes } from 'nocodb-sdk'; import { Logger } from '@nestjs/common'; +import { isLinksOrLTAR } from '../../../../../../nocodb-sdk/src' import { Base, Column, Model, Project } from '../../../../models'; import { ProjectsService } from '../../../../services/projects.service'; import { findWithIdentifier } from '../../../../helpers/exportImportHelpers'; @@ -137,7 +137,7 @@ export class DuplicateProcessor { await sourceModel.getColumns(); const relatedModelIds = sourceModel.columns - .filter((col) => col.uidt === UITypes.LinkToAnotherRecord) + .filter((col) => isLinksOrLTAR(col)) .map((col) => col.colOptions.fk_related_model_id) .filter((id) => id); @@ -186,7 +186,7 @@ export class DuplicateProcessor { const bts = md.columns .filter( (c) => - c.uidt === UITypes.LinkToAnotherRecord && + isLinksOrLTAR(c) && c.colOptions.type === 'bt' && c.colOptions.fk_related_model_id === modelId, ) 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 ad4b83a82b..68289259c0 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 @@ -1,6 +1,7 @@ import { UITypes, ViewTypes } from 'nocodb-sdk'; import { Injectable, Logger } from '@nestjs/common'; import papaparse from 'papaparse'; +import { isLinksOrLTAR } from '../../../../../../nocodb-sdk/src' import { findWithIdentifier, generateUniqueName, @@ -125,7 +126,7 @@ export class ImportService { const reducedColumnSet = modelData.columns.filter( (a) => - a.uidt !== UITypes.LinkToAnotherRecord && + !isLinksOrLTAR(a) && a.uidt !== UITypes.Lookup && a.uidt !== UITypes.Rollup && a.uidt !== UITypes.Formula && @@ -166,7 +167,7 @@ export class ImportService { const table = tableReferences.get(modelData.id); const linkedColumnSet = modelData.columns.filter( - (a) => a.uidt === UITypes.LinkToAnotherRecord, + (a) => isLinksOrLTAR(a) ); for (const col of linkedColumnSet) {