Don't prepend override field name.
This commit is contained in:
parent
f0ab6ac92a
commit
26342ec75c
@ -300,13 +300,13 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
|||||||
relationship.AssociationForeignFieldNames = append(relationship.AssociationForeignFieldNames, field.DBName)
|
relationship.AssociationForeignFieldNames = append(relationship.AssociationForeignFieldNames, field.DBName)
|
||||||
|
|
||||||
// If a new name was provided for the field, use it
|
// If a new name was provided for the field, use it
|
||||||
name = field.DBName
|
name = ToDBName(elemType.Name()) + "_" + field.DBName
|
||||||
if len(parts) > 1 {
|
if len(parts) > 1 {
|
||||||
name = parts[1]
|
name = parts[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
// join table foreign keys for association
|
// join table foreign keys for association
|
||||||
joinTableDBName := ToDBName(elemType.Name()) + "_" + name
|
joinTableDBName := name
|
||||||
relationship.AssociationForeignDBNames = append(relationship.AssociationForeignDBNames, joinTableDBName)
|
relationship.AssociationForeignDBNames = append(relationship.AssociationForeignDBNames, joinTableDBName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user