Browse Source

fix: add external primary keys to idMap

Signed-off-by: mertmit <mertmit99@gmail.com>
feat/export-nest
mertmit 2 years ago
parent
commit
60f8ab8fbe
  1. 1
      packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts
  2. 8
      packages/nocodb/src/modules/jobs/export-import/import.service.ts

1
packages/nocodb/src/modules/jobs/export-import/duplicate.processor.ts

@ -536,7 +536,6 @@ export class DuplicateProcessor {
}, },
complete: async () => { complete: async () => {
if (chunk.length > 0) { if (chunk.length > 0) {
console.log('chunk', chunk);
try { try {
await this.bulkDataService.bulkDataUpdate({ await this.bulkDataService.bulkDataUpdate({
projectName: destProject.id, projectName: destProject.id,

8
packages/nocodb/src/modules/jobs/export-import/import.service.ts

@ -86,6 +86,14 @@ export class ImportService {
await model.getColumns(); 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) { for (const col of model.columns) {
externalIdMap.set(`${idMap.get(model.id)}::${col.id}`, col.id); externalIdMap.set(`${idMap.get(model.id)}::${col.id}`, col.id);
} }

Loading…
Cancel
Save