title foreign schema for many2many to avoid panic (#4496)

Co-authored-by: yuehong.wang <yuehong.wang@dena.jp>
This commit is contained in:
wangyuehong 2021-07-13 17:36:22 +09:00 committed by GitHub
parent 16579e00c6
commit 80497f27a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -238,7 +238,7 @@ func (schema *Schema) buildMany2ManyRelation(relation *Relationship, field *Fiel
} }
for idx, relField := range refForeignFields { for idx, relField := range refForeignFields {
joinFieldName := relation.FieldSchema.Name + relField.Name joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name
if len(joinReferences) > idx { if len(joinReferences) > idx {
joinFieldName = strings.Title(joinReferences[idx]) joinFieldName = strings.Title(joinReferences[idx])
} }