Merge d44a47525fe8f338208ab19a142a0e507474b766 into 21fb3ae1febe4581f80a4d5633f3fffd6d10a606
This commit is contained in:
		
						commit
						0689964551
					
				@ -276,7 +276,10 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
 | 
			
		||||
											// source foreign keys (db names)
 | 
			
		||||
											relationship.ForeignFieldNames = append(relationship.ForeignFieldNames, foreignField.DBName)
 | 
			
		||||
											// join table foreign keys for source
 | 
			
		||||
											joinTableDBName := ToDBName(reflectType.Name()) + "_" + foreignField.DBName
 | 
			
		||||
											joinTableDBName := ToDBName(field.TagSettings["FOREIGNCOLUMN"])
 | 
			
		||||
											if len(joinTableDBName) == 0 {
 | 
			
		||||
												joinTableDBName = ToDBName(reflectType.Name()) + "_" + foreignField.DBName
 | 
			
		||||
											}
 | 
			
		||||
											relationship.ForeignDBNames = append(relationship.ForeignDBNames, joinTableDBName)
 | 
			
		||||
										}
 | 
			
		||||
									}
 | 
			
		||||
@ -293,7 +296,10 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
 | 
			
		||||
											// association foreign keys (db names)
 | 
			
		||||
											relationship.AssociationForeignFieldNames = append(relationship.AssociationForeignFieldNames, field.DBName)
 | 
			
		||||
											// join table foreign keys for association
 | 
			
		||||
											joinTableDBName := ToDBName(elemType.Name()) + "_" + field.DBName
 | 
			
		||||
											joinTableDBName := ToDBName(field.TagSettings["ASSOCIATIONFOREIGNCOLUMN"])
 | 
			
		||||
											if len(joinTableDBName) == 0 {
 | 
			
		||||
												joinTableDBName = ToDBName(reflectType.Name()) + "_" + field.DBName
 | 
			
		||||
											}
 | 
			
		||||
											relationship.AssociationForeignDBNames = append(relationship.AssociationForeignDBNames, joinTableDBName)
 | 
			
		||||
										}
 | 
			
		||||
									}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user