diff --git a/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts b/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts index 8b6dc8aa38..70b9833679 100644 --- a/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts +++ b/packages/nocodb/src/modules/jobs/migration-jobs/nc_job_001_attachment.ts @@ -202,17 +202,6 @@ export class AttachmentMigrationProcessor { base_id, }; - const attachmentColumns = await ncMeta - .knexConnection(MetaTable.COLUMNS) - .select('id', 'title', 'column_name') - .where('uidt', UITypes.Attachment) - .where('fk_model_id', fk_model_id); - - if (!attachmentColumns?.length) { - this.log(`no attachment columns found for ${fk_model_id}`); - continue; - } - const source = await Source.get(context, source_id); if (!source) { @@ -229,6 +218,10 @@ export class AttachmentMigrationProcessor { await model.getColumns(context); + const attachmentColumns = model.columns.filter( + (c) => c.uidt === UITypes.Attachment, + ); + const dbDriver = await NcConnectionMgrv2.get(source); if (!dbDriver) {