diff --git a/go.mod b/go.mod index 9e2569495..ef2cd2288 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/superseriousbusiness/exifremove v0.0.0-20210330092427-6acd27eac203 github.com/superseriousbusiness/oauth2/v4 v4.3.2-SSB github.com/tdewolff/minify/v2 v2.9.21 - github.com/uptrace/bun v1.0.5 + github.com/uptrace/bun v1.0.6 github.com/uptrace/bun/dialect/pgdialect v1.0.5 github.com/uptrace/bun/dialect/sqlitedialect v1.0.5 github.com/urfave/cli/v2 v2.3.0 diff --git a/go.sum b/go.sum index c5128818e..f8ea8e454 100644 --- a/go.sum +++ b/go.sum @@ -450,8 +450,9 @@ github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= -github.com/uptrace/bun v1.0.5 h1:bNhNhWt6XNwSWMEQUvYK7iJ3qHrMfeoKY3/w2jkqcBs= github.com/uptrace/bun v1.0.5/go.mod h1:aL6D9vPw8DXaTQTwGrEPtUderBYXx7ShUmPfnxnqscw= +github.com/uptrace/bun v1.0.6 h1:o9eMq5ePGBXtxbK3SIreOCRr+rIBQzvJH+/s98kYcVM= +github.com/uptrace/bun v1.0.6/go.mod h1:aL6D9vPw8DXaTQTwGrEPtUderBYXx7ShUmPfnxnqscw= github.com/uptrace/bun/dialect/pgdialect v1.0.5 h1:mq694/aMvs7GwuTar9NIlCLQt/2u4xsF0QMP4I24yHA= github.com/uptrace/bun/dialect/pgdialect v1.0.5/go.mod h1:MKWjO0PC20ris2oJ3dd6mI/762x24Cjwh8XmbqUhM8A= github.com/uptrace/bun/dialect/sqlitedialect v1.0.5 h1:6cIj31YVJr4vvA15C2v76soXL+7WtjFdV6WraApc3r0= diff --git a/vendor/github.com/uptrace/bun/CHANGELOG.md b/vendor/github.com/uptrace/bun/CHANGELOG.md index 98a08de72..c7031830c 100644 --- a/vendor/github.com/uptrace/bun/CHANGELOG.md +++ b/vendor/github.com/uptrace/bun/CHANGELOG.md @@ -1,4 +1,12 @@ -# Changelog +## [1.0.6](https://github.com/uptrace/bun/compare/v1.0.5...v1.0.6) (2021-09-11) + + +### Bug Fixes + +* change unique tag to create a separate unique constraint ([8401615](https://github.com/uptrace/bun/commit/84016155a77ca77613cc054277fefadae3098757)) +* improve zero checker for ptr values ([2b3623d](https://github.com/uptrace/bun/commit/2b3623dd665d873911fd20ca707016929921e862)) + + ## v1.0.5 - Sep 09 2021 diff --git a/vendor/github.com/uptrace/bun/commitlint.config.js b/vendor/github.com/uptrace/bun/commitlint.config.js new file mode 100644 index 000000000..4fedde6da --- /dev/null +++ b/vendor/github.com/uptrace/bun/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] } diff --git a/vendor/github.com/uptrace/bun/package.json b/vendor/github.com/uptrace/bun/package.json new file mode 100644 index 000000000..a4651c19d --- /dev/null +++ b/vendor/github.com/uptrace/bun/package.json @@ -0,0 +1,8 @@ +{ + "name": "bun", + "version": "1.0.6", + "main": "index.js", + "repository": "git@github.com:uptrace/bun.git", + "author": "Vladimir Mihailenco ", + "license": "BSD-2-clause" +} diff --git a/vendor/github.com/uptrace/bun/query_table_create.go b/vendor/github.com/uptrace/bun/query_table_create.go index a5fa8e231..08c68e054 100644 --- a/vendor/github.com/uptrace/bun/query_table_create.go +++ b/vendor/github.com/uptrace/bun/query_table_create.go @@ -186,14 +186,20 @@ func (q *CreateTableQuery) appendUniqueConstraints(fmter schema.Formatter, b []b sort.Strings(keys) for _, key := range keys { - b = q.appendUniqueConstraint(fmter, b, key, unique[key]) + if key == "" { + for _, field := range unique[key] { + b = q.appendUniqueConstraint(fmter, b, key, field) + } + continue + } + b = q.appendUniqueConstraint(fmter, b, key, unique[key]...) } return b } func (q *CreateTableQuery) appendUniqueConstraint( - fmter schema.Formatter, b []byte, name string, fields []*schema.Field, + fmter schema.Formatter, b []byte, name string, fields ...*schema.Field, ) []byte { if name != "" { b = append(b, ", CONSTRAINT "...) @@ -204,7 +210,6 @@ func (q *CreateTableQuery) appendUniqueConstraint( b = append(b, " UNIQUE ("...) b = appendColumns(b, "", fields) b = append(b, ")"...) - return b } 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 diff --git a/vendor/github.com/uptrace/bun/schema/zerochecker.go b/vendor/github.com/uptrace/bun/schema/zerochecker.go index 95efeee6b..f088b8c2c 100644 --- a/vendor/github.com/uptrace/bun/schema/zerochecker.go +++ b/vendor/github.com/uptrace/bun/schema/zerochecker.go @@ -13,10 +13,6 @@ type isZeroer interface { type IsZeroerFunc func(reflect.Value) bool -func FieldZeroChecker(field *Field) IsZeroerFunc { - return zeroChecker(field.IndirectType) -} - func zeroChecker(typ reflect.Type) IsZeroerFunc { if typ.Implements(isZeroerType) { return isZeroInterface diff --git a/vendor/github.com/uptrace/bun/version.go b/vendor/github.com/uptrace/bun/version.go index 58297a02d..f81c108fd 100644 --- a/vendor/github.com/uptrace/bun/version.go +++ b/vendor/github.com/uptrace/bun/version.go @@ -2,5 +2,5 @@ // Version is the current release version. func Version() string { - return "1.0.5" + return "1.0.6" } diff --git a/vendor/modules.txt b/vendor/modules.txt index 21dc9fc88..b68660001 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -418,7 +418,7 @@ github.com/tmthrgd/go-hex # github.com/ugorji/go/codec v1.2.6 ## explicit; go 1.11 github.com/ugorji/go/codec -# github.com/uptrace/bun v1.0.5 +# github.com/uptrace/bun v1.0.6 ## explicit; go 1.16 github.com/uptrace/bun github.com/uptrace/bun/dialect