From 3dfef3d455a01903807b713683f835242d7f558e Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 18 Apr 2023 01:33:46 +0300 Subject: [PATCH] fix: check composite pk while detecting bridge table Signed-off-by: mertmit --- packages/nocodb/src/lib/services/metaDiff.svc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();