forked from mirror/gorm
Don't set primary key is alrady exists
This commit is contained in:
parent
bdaecff30d
commit
bbb3b50d0a
|
@ -65,7 +65,7 @@ func Create(scope *Scope) {
|
|||
}
|
||||
}
|
||||
|
||||
if !scope.HasError() {
|
||||
if !scope.HasError() && scope.PrimaryKeyZero() {
|
||||
scope.SetColumn(scope.PrimaryKey(), id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue