Browse Source

fix: at-import symmetric column issue

pull/7391/head
mertmit 8 months ago
parent
commit
6fa7781a26
  1. 13
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

13
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -865,15 +865,6 @@ export class AtImportProcessor {
);
}
// check if already a column exists with this name?
const duplicate = childTblSchema.columns.find(
(x) => x.title === aTblLinkColumns[i].name,
);
const suffix = duplicate ? '_2' : '';
if (duplicate)
if (enableErrorLogs)
console.log(`## Duplicate ${aTblLinkColumns[i].name}`);
// rename
// note that: current rename API requires us to send all parameters,
// not just title being renamed
@ -900,12 +891,12 @@ export class AtImportProcessor {
updateNcTblSchema(ncTbl);
const ncId = ncTbl.columns.find(
(x) => x.title === aTblLinkColumns[i].name + suffix,
(x) => x.title === ncName.title,
)?.id;
await sMap.addToMappingTbl(
aTblLinkColumns[i].id,
ncId,
aTblLinkColumns[i].name + suffix,
ncName.title,
ncTbl.id,
);
}

Loading…
Cancel
Save