mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 17:42:25 -05:00
[chore] Update bun and sqlite dependencies (#478)
* update bun + sqlite versions * step bun to v1.1.3
This commit is contained in:
parent
8d34d5af3c
commit
88979b35d4
246 changed files with 409690 additions and 148967 deletions
26
vendor/github.com/uptrace/bun/query_table_create.go
generated
vendored
26
vendor/github.com/uptrace/bun/query_table_create.go
generated
vendored
|
|
@ -102,6 +102,21 @@ func (q *CreateTableQuery) TableSpace(tablespace string) *CreateTableQuery {
|
|||
return q
|
||||
}
|
||||
|
||||
func (q *CreateTableQuery) WithForeignKeys() *CreateTableQuery {
|
||||
for _, relation := range q.tableModel.Table().Relations {
|
||||
if relation.Type == schema.ManyToManyRelation ||
|
||||
relation.Type == schema.HasManyRelation {
|
||||
continue
|
||||
}
|
||||
q = q.ForeignKey("(?) REFERENCES ? (?)",
|
||||
Safe(appendColumns(nil, "", relation.BaseFields)),
|
||||
relation.JoinTable.SQLName,
|
||||
Safe(appendColumns(nil, "", relation.JoinFields)),
|
||||
)
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func (q *CreateTableQuery) Operation() string {
|
||||
|
|
@ -121,7 +136,7 @@ func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []by
|
|||
b = append(b, "TEMP "...)
|
||||
}
|
||||
b = append(b, "TABLE "...)
|
||||
if q.ifNotExists {
|
||||
if q.ifNotExists && fmter.Dialect().Features().Has(feature.TableNotExists) {
|
||||
b = append(b, "IF NOT EXISTS "...)
|
||||
}
|
||||
b, err = q.appendFirstTable(fmter, b)
|
||||
|
|
@ -142,8 +157,13 @@ func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []by
|
|||
if field.NotNull {
|
||||
b = append(b, " NOT NULL"...)
|
||||
}
|
||||
if fmter.Dialect().Features().Has(feature.AutoIncrement) && field.AutoIncrement {
|
||||
b = append(b, " AUTO_INCREMENT"...)
|
||||
if field.AutoIncrement {
|
||||
switch {
|
||||
case fmter.Dialect().Features().Has(feature.AutoIncrement):
|
||||
b = append(b, " AUTO_INCREMENT"...)
|
||||
case fmter.Dialect().Features().Has(feature.Identity):
|
||||
b = append(b, " IDENTITY"...)
|
||||
}
|
||||
}
|
||||
if field.SQLDefault != "" {
|
||||
b = append(b, " DEFAULT "...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue