From 0b3e70b19b5c988716cf287f418a97c0765b6acf Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 22 Sep 2021 23:11:28 +0800 Subject: [PATCH] Fix problem when database id is not increment as expected --- models/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/action.go b/models/action.go index f957e2b0cd9ac..f17f75779bd62 100644 --- a/models/action.go +++ b/models/action.go @@ -317,7 +317,7 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { actions := make([]*Action, 0, setting.UI.FeedPagingNum) - if err := db.DefaultContext().Engine().Limit(setting.UI.FeedPagingNum).Desc("id").Where(cond).Find(&actions); err != nil { + if err := db.DefaultContext().Engine().Limit(setting.UI.FeedPagingNum).Desc("created_unix").Where(cond).Find(&actions); err != nil { return nil, fmt.Errorf("Find: %v", err) }