Don't scan last insert id 0
This commit is contained in:
		
							parent
							
								
									6ed697dd02
								
							
						
					
					
						commit
						c3f52cee8b
					
				| @ -78,7 +78,9 @@ func Create(config *Config) func(db *gorm.DB) { | |||||||
| 											} | 											} | ||||||
| 										} | 										} | ||||||
| 									case reflect.Struct: | 									case reflect.Struct: | ||||||
| 										db.Statement.Schema.PrioritizedPrimaryField.Set(db.Statement.ReflectValue, insertID) | 										if insertID > 0 { | ||||||
|  | 											db.Statement.Schema.PrioritizedPrimaryField.Set(db.Statement.ReflectValue, insertID) | ||||||
|  | 										} | ||||||
| 									} | 									} | ||||||
| 								} else { | 								} else { | ||||||
| 									db.AddError(err) | 									db.AddError(err) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jinzhu
						Jinzhu