From 80497f27a61df4daea49b1ec1bb1d473459fa28f Mon Sep 17 00:00:00 2001 From: wangyuehong Date: Tue, 13 Jul 2021 17:36:22 +0900 Subject: [PATCH] title foreign schema for many2many to avoid panic (#4496) Co-authored-by: yuehong.wang --- schema/relationship.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/relationship.go b/schema/relationship.go index db496e30..84556bae 100644 --- a/schema/relationship.go +++ b/schema/relationship.go @@ -238,7 +238,7 @@ func (schema *Schema) buildMany2ManyRelation(relation *Relationship, field *Fiel } for idx, relField := range refForeignFields { - joinFieldName := relation.FieldSchema.Name + relField.Name + joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name if len(joinReferences) > idx { joinFieldName = strings.Title(joinReferences[idx]) }