Skip to content

Commit

Permalink
generate Related for many-to-many relation with extra columns (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
limjiayi authored and tyt2y3 committed Dec 2, 2022
1 parent cdbb8c7 commit 3532607
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sea-orm-codegen/src/entity/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ impl EntityTransformer {
if rel.num_suffix > 0 {
continue;
}
let is_conjunct_relation = entity.primary_keys.len() == entity.columns.len()
&& entity.relations.len() == 2
&& entity.primary_keys.len() == 2;
let is_conjunct_relation =
entity.relations.len() == 2 && entity.primary_keys.len() == 2;
match is_conjunct_relation {
true => {
let another_rel = entity.relations.get((i == 0) as usize).unwrap();
Expand Down

0 comments on commit 3532607

Please sign in to comment.