Fix onConflict with non-updatable in associations
This commit is contained in:
		
							parent
							
								
									093694fbf2
								
							
						
					
					
						commit
						4b170be27d
					
				@ -314,7 +314,7 @@ func onConflictOption(stmt *gorm.Statement, s *schema.Schema, selectColumns map[
 | 
			
		||||
	if stmt.DB.FullSaveAssociations {
 | 
			
		||||
		defaultUpdatingColumns = make([]string, 0, len(s.DBNames))
 | 
			
		||||
		for _, dbName := range s.DBNames {
 | 
			
		||||
			if v, ok := selectColumns[dbName]; (ok && !v) || (!ok && restricted) {
 | 
			
		||||
			if v, ok := selectColumns[dbName]; (ok && !v) || (!ok && restricted) || !s.FieldsByDBName[dbName].Updatable {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user