From 26342ec75c7236b2399a133351b16faf12372e1b Mon Sep 17 00:00:00 2001 From: Jason Chavannes Date: Tue, 16 Jan 2018 09:11:11 -0800 Subject: [PATCH] Don't prepend override field name. --- model_struct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model_struct.go b/model_struct.go index 463ec517..205b8ba4 100644 --- a/model_struct.go +++ b/model_struct.go @@ -300,13 +300,13 @@ func (scope *Scope) GetModelStruct() *ModelStruct { relationship.AssociationForeignFieldNames = append(relationship.AssociationForeignFieldNames, field.DBName) // If a new name was provided for the field, use it - name = field.DBName + name = ToDBName(elemType.Name()) + "_" + field.DBName if len(parts) > 1 { name = parts[1] } // join table foreign keys for association - joinTableDBName := ToDBName(elemType.Name()) + "_" + name + joinTableDBName := name relationship.AssociationForeignDBNames = append(relationship.AssociationForeignDBNames, joinTableDBName) } }