From 5aea5bf338844c5d50d3f5546c1ed08dc9afb222 Mon Sep 17 00:00:00 2001 From: quintans Date: Wed, 27 Nov 2019 01:28:18 +0000 Subject: [PATCH] fix: on insert, only set generated id, if it was empty --- db/Insert.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/Insert.go b/db/Insert.go index 5d4de15..ee72375 100644 --- a/db/Insert.go +++ b/db/Insert.go @@ -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)) }