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/query_table_create.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/uptrace/bun/query_table_create.go') 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 } -- cgit v1.2.3