From a3fb8e8b0dcedb9f8eb0764597ea2d2318ed66e0 Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Wed, 26 Oct 2022 11:20:33 +0800 Subject: [PATCH] [cli] generate `Related` for m-to-n relation (#1075) --- sea-orm-codegen/src/entity/transformer.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sea-orm-codegen/src/entity/transformer.rs b/sea-orm-codegen/src/entity/transformer.rs index 0c0da7d50..3fb553db0 100644 --- a/sea-orm-codegen/src/entity/transformer.rs +++ b/sea-orm-codegen/src/entity/transformer.rs @@ -136,8 +136,7 @@ impl EntityTransformer { continue; } let is_conjunct_relation = entity.primary_keys.len() == entity.columns.len() - && rel.columns.len() == 2 - && rel.ref_columns.len() == 2 + && entity.relations.len() == 2 && entity.primary_keys.len() == 2; match is_conjunct_relation { true => {