mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
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>
This commit is contained in:
11
vendor/github.com/uptrace/bun/query_table_create.go
generated
vendored
11
vendor/github.com/uptrace/bun/query_table_create.go
generated
vendored
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user