forked from mirror/gorm
title case schema name (#3940)
This commit is contained in:
parent
de850edb4f
commit
ce610a9560
|
@ -219,7 +219,7 @@ func (schema *Schema) buildMany2ManyRelation(relation *Relationship, field *Fiel
|
|||
}
|
||||
|
||||
for idx, ownField := range ownForeignFields {
|
||||
joinFieldName := schema.Name + ownField.Name
|
||||
joinFieldName := strings.Title(schema.Name) + ownField.Name
|
||||
if len(joinForeignKeys) > idx {
|
||||
joinFieldName = strings.Title(joinForeignKeys[idx])
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ func (schema *Schema) buildMany2ManyRelation(relation *Relationship, field *Fiel
|
|||
}
|
||||
|
||||
joinTableFields = append(joinTableFields, reflect.StructField{
|
||||
Name: schema.Name + field.Name,
|
||||
Name: strings.Title(schema.Name) + field.Name,
|
||||
Type: schema.ModelType,
|
||||
Tag: `gorm:"-"`,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue