mirror of https://github.com/go-gorm/gorm.git
Don't scan last insert id 0
This commit is contained in:
parent
6ed697dd02
commit
c3f52cee8b
|
@ -78,8 +78,10 @@ func Create(config *Config) func(db *gorm.DB) {
|
|||
}
|
||||
}
|
||||
case reflect.Struct:
|
||||
if insertID > 0 {
|
||||
db.Statement.Schema.PrioritizedPrimaryField.Set(db.Statement.ReflectValue, insertID)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
db.AddError(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue