1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-21 12:44:49 -05:00

Merge pull request 'fix: don't specify FOR clause for index hint' (#6188) from gusted/forgejo-mariadb-2 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6188
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-12-07 06:46:42 +00:00
commit 48131547a1

View file

@ -113,7 +113,7 @@ func getNotifications(ctx *context.Context) {
sess := db.GetEngine(ctx).Table("notification")
if setting.Database.Type.IsMySQL() {
sess = sess.IndexHint("USE", "JOIN", "IDX_notification_user_id")
sess = sess.IndexHint("USE", "", "IDX_notification_user_id")
}
sess.Where("user_id = ?", ctx.Doer.ID).
And("status = ? OR status = ?", status, activities_model.NotificationStatusPinned).