From bac4ee998054a998943e9a596bfd3752d0f8a059 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sat, 11 Sep 2021 12:53:44 +0100 Subject: update bun library to latest commit (#206) * update bun library to latest commit Signed-off-by: kim (grufwub) * update to latest bun release Signed-off-by: kim (grufwub) --- vendor/github.com/uptrace/bun/schema/table.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/uptrace/bun/schema/table.go') diff --git a/vendor/github.com/uptrace/bun/schema/table.go b/vendor/github.com/uptrace/bun/schema/table.go index 7498a2bc8..8bed5ed38 100644 --- a/vendor/github.com/uptrace/bun/schema/table.go +++ b/vendor/github.com/uptrace/bun/schema/table.go @@ -193,10 +193,15 @@ func (t *Table) initFields() { } } if len(t.PKs) == 1 { - switch t.PKs[0].IndirectType.Kind() { + pk := t.PKs[0] + if pk.SQLDefault != "" { + return + } + + switch pk.IndirectType.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - t.PKs[0].AutoIncrement = true + pk.AutoIncrement = true } } } @@ -359,7 +364,7 @@ func (t *Table) newField(f reflect.StructField, index []int) *Field { field.DiscoveredSQLType = DiscoverSQLType(field.IndirectType) field.Append = t.dialect.FieldAppender(field) field.Scan = FieldScanner(t.dialect, field) - field.IsZero = FieldZeroChecker(field) + field.IsZero = zeroChecker(field.StructField.Type) if v, ok := tag.Options["alt"]; ok { t.FieldMap[v] = field -- cgit v1.2.3