mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-08 22:13:26 +09:00
chore(db): introduce db.Session and db.EngineMigration interfaces (#37746)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
wxiaoguang
wxiaoguang
parent
d9149d8a0a
commit
94e3482d1a
+1
-1
@@ -77,7 +77,7 @@ func GetStargazers(ctx context.Context, repo *Repository, opts db.ListOptions) (
|
||||
sess := db.GetEngine(ctx).Where("star.repo_id = ?", repo.ID).
|
||||
Join("LEFT", "star", "`user`.id = star.uid")
|
||||
if opts.Page > 0 {
|
||||
sess = db.SetSessionPagination(sess, &opts)
|
||||
db.SetSessionPagination(sess, &opts)
|
||||
|
||||
users := make([]*user_model.User, 0, opts.PageSize)
|
||||
return users, sess.Find(&users)
|
||||
|
||||
@@ -152,7 +152,7 @@ func GetRepoWatchers(ctx context.Context, repoID int64, opts db.ListOptions) ([]
|
||||
Join("LEFT", "watch", "`user`.id=`watch`.user_id").
|
||||
And("`watch`.mode<>?", WatchModeDont)
|
||||
if opts.Page > 0 {
|
||||
sess = db.SetSessionPagination(sess, &opts)
|
||||
db.SetSessionPagination(sess, &opts)
|
||||
users := make([]*user_model.User, 0, opts.PageSize)
|
||||
|
||||
return users, sess.Find(&users)
|
||||
|
||||
Reference in New Issue
Block a user