summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/query_table_create.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-29 15:09:45 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-29 15:09:45 +0200
commit9a53b1a8d19da525ca7ace957b2d32f85dbe0fe9 (patch)
tree5f7a391618a0d1c68ab1f21ef4bd18ff034486ec /vendor/github.com/uptrace/bun/query_table_create.go
parentskip account on error instead of returning error (#251) (diff)
downloadgotosocial-9a53b1a8d19da525ca7ace957b2d32f85dbe0fe9.tar.xz
upstep bun to v1.0.9 (#252)
Diffstat (limited to 'vendor/github.com/uptrace/bun/query_table_create.go')
-rw-r--r--vendor/github.com/uptrace/bun/query_table_create.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/uptrace/bun/query_table_create.go b/vendor/github.com/uptrace/bun/query_table_create.go
index 08c68e054..78910d5eb 100644
--- a/vendor/github.com/uptrace/bun/query_table_create.go
+++ b/vendor/github.com/uptrace/bun/query_table_create.go
@@ -63,6 +63,11 @@ func (q *CreateTableQuery) ModelTableExpr(query string, args ...interface{}) *Cr
return q
}
+func (q *CreateTableQuery) ColumnExpr(query string, args ...interface{}) *CreateTableQuery {
+ q.addColumn(schema.SafeQuery(query, args))
+ return q
+}
+
//------------------------------------------------------------------------------
func (q *CreateTableQuery) Temp() *CreateTableQuery {
@@ -132,6 +137,14 @@ func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []by
}
}
+ for _, col := range q.columns {
+ b = append(b, ", "...)
+ b, err = col.AppendQuery(fmter, b)
+ if err != nil {
+ return nil, err
+ }
+ }
+
b = q.appendPKConstraint(b, q.table.PKs)
b = q.appendUniqueConstraints(fmter, b)
b, err = q.appenFKConstraints(fmter, b)