summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/schema/table.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2021-09-11 12:53:44 +0100
committerLibravatar GitHub <noreply@github.com>2021-09-11 13:53:44 +0200
commitbac4ee998054a998943e9a596bfd3752d0f8a059 (patch)
tree5eed824171d7adaa407574e9ee634d93966f4e26 /vendor/github.com/uptrace/bun/schema/table.go
parentfix broken build (#209) (diff)
downloadgotosocial-bac4ee998054a998943e9a596bfd3752d0f8a059.tar.xz
update bun library to latest commit (#206)
* update bun library to latest commit Signed-off-by: kim (grufwub) <grufwub@gmail.com> * update to latest bun release Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'vendor/github.com/uptrace/bun/schema/table.go')
-rw-r--r--vendor/github.com/uptrace/bun/schema/table.go11
1 files changed, 8 insertions, 3 deletions
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