mirror of https://github.com/go-gorm/gorm.git
Fix postgres tests
This commit is contained in:
parent
969ab67636
commit
d61b7db8fa
|
@ -97,7 +97,11 @@ func (structField *StructField) clone() *StructField {
|
|||
TagSettings: map[string]string{},
|
||||
Struct: structField.Struct,
|
||||
IsForeignKey: structField.IsForeignKey,
|
||||
Relationship: structField.Relationship,
|
||||
}
|
||||
|
||||
if structField.Relationship != nil {
|
||||
relationship := *structField.Relationship
|
||||
clone.Relationship = &relationship
|
||||
}
|
||||
|
||||
for key, value := range structField.TagSettings {
|
||||
|
@ -222,7 +226,9 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
|||
|
||||
if subField.Relationship != nil && subField.Relationship.JoinTableHandler != nil {
|
||||
if joinTableHandler, ok := subField.Relationship.JoinTableHandler.(*JoinTableHandler); ok {
|
||||
joinTableHandler.Setup(subField.Relationship, joinTableHandler.TableName, reflectType, joinTableHandler.Destination.ModelType)
|
||||
newJoinTableHandler := &JoinTableHandler{}
|
||||
newJoinTableHandler.Setup(subField.Relationship, joinTableHandler.TableName, reflectType, joinTableHandler.Destination.ModelType)
|
||||
subField.Relationship.JoinTableHandler = newJoinTableHandler
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue