From 8ef5d8136d2cd19f87d482bb6644b6ddac2a0af0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 9 May 2022 21:41:23 +0800 Subject: [PATCH 1/2] Don't select join table --- models/action.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/action.go b/models/action.go index efbe243bed3b9..f6f1bd1a11f9f 100644 --- a/models/action.go +++ b/models/action.go @@ -340,7 +340,9 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) { } e := db.GetEngine(ctx) - sess := e.Where(cond).Join("INNER", "repository", "`repository`.id = `action`.repo_id") + sess := e.Where(cond). + Select("`action`.*"). + Join("INNER", "repository", "`repository`.id = `action`.repo_id") opts.SetDefaultValues() sess = db.SetSessionPagination(sess, &opts) From eb55bf754140db868eba944e988b6f11f383f894 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 9 May 2022 21:43:15 +0800 Subject: [PATCH 2/2] Add comment --- models/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/action.go b/models/action.go index f6f1bd1a11f9f..7055ce81d60d9 100644 --- a/models/action.go +++ b/models/action.go @@ -341,7 +341,7 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) { e := db.GetEngine(ctx) sess := e.Where(cond). - Select("`action`.*"). + Select("`action`.*"). // this line will avoid select other joined table's columns Join("INNER", "repository", "`repository`.id = `action`.repo_id") opts.SetDefaultValues()