Skip to content

Commit

Permalink
fix: on insert, only set generated id, if it was empty
Browse files Browse the repository at this point in the history
  • Loading branch information
quintans committed Nov 27, 2019
1 parent 9aa3efd commit 5aea5bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/Insert.go
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ func (this *Insert) Submit(instance interface{}) (int64, error) {
}

column := this.table.GetSingleKeyColumn()
if column != nil {
if column != nil && !this.HasKeyValue {
bp := mappings[column.GetAlias()]
bp.Set(elem, reflect.ValueOf(&key))
}

0 comments on commit 5aea5bf

Please sign in to comment.