generate Related for many-to-many relation with extra columns (#1260)

This commit is contained in:
jiayi 2022-12-01 13:14:20 +08:00 committed by GitHub
parent dd7454a738
commit 8e888eda7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();