diff --git a/packages/nocodb/src/lib/services/metaDiff.svc.ts b/packages/nocodb/src/lib/services/metaDiff.svc.ts index 132dc33d38..68372ba98b 100644 --- a/packages/nocodb/src/lib/services/metaDiff.svc.ts +++ b/packages/nocodb/src/lib/services/metaDiff.svc.ts @@ -1010,7 +1010,7 @@ export async function extractAndGenerateManyToManyRelations( } // todo: impl better method to identify m2m relation - if (belongsToCols?.length === 2 && normalColumns.length < 5) { + if (belongsToCols?.length === 2 && normalColumns.length < 5 && assocModel.primaryKeys.length === 2) { const modelA = await belongsToCols[0].colOptions.getRelatedTable(); const modelB = await belongsToCols[1].colOptions.getRelatedTable();