mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 23:42:24 -06:00
should be good now
This commit is contained in:
parent
9a6577ccec
commit
d9549e7638
2 changed files with 4 additions and 13 deletions
|
|
@ -892,9 +892,7 @@ func qMediaOnly(ctx context.Context, q *bun.SelectQuery) *bun.SelectQuery {
|
||||||
case dialect.SQLite:
|
case dialect.SQLite:
|
||||||
return q.
|
return q.
|
||||||
Where("? IS NOT NULL", bun.Ident("status.attachments")).
|
Where("? IS NOT NULL", bun.Ident("status.attachments")).
|
||||||
Where("? != ''", bun.Ident("status.attachments")).
|
|
||||||
Where("? != 'null'", bun.Ident("status.attachments")).
|
Where("? != 'null'", bun.Ident("status.attachments")).
|
||||||
Where("? != '{}'", bun.Ident("status.attachments")).
|
|
||||||
Where("? != '[]'", bun.Ident("status.attachments"))
|
Where("? != '[]'", bun.Ident("status.attachments"))
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,10 @@ func init() {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: "attachments" field is not included in
|
||||||
|
// the index below as SQLite is fussy about using it,
|
||||||
|
// and it prevents this index from being used
|
||||||
|
// properly in non media-only queries.
|
||||||
if _, err := tx.
|
if _, err := tx.
|
||||||
NewCreateIndex().
|
NewCreateIndex().
|
||||||
Table("statuses").
|
Table("statuses").
|
||||||
|
|
@ -60,18 +64,7 @@ func init() {
|
||||||
"in_reply_to_uri",
|
"in_reply_to_uri",
|
||||||
"boost_of_id",
|
"boost_of_id",
|
||||||
"federated",
|
"federated",
|
||||||
"attachments",
|
|
||||||
).
|
).
|
||||||
IfNotExists().
|
|
||||||
Exec(ctx); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := tx.
|
|
||||||
NewCreateIndex().
|
|
||||||
Table("statuses").
|
|
||||||
Index("statuses_profile_web_view_order_by_idx").
|
|
||||||
Column("account_id", "federated").
|
|
||||||
ColumnExpr("? DESC", bun.Ident("id")).
|
ColumnExpr("? DESC", bun.Ident("id")).
|
||||||
IfNotExists().
|
IfNotExists().
|
||||||
Exec(ctx); err != nil {
|
Exec(ctx); err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue