diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-05-09 23:19:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 23:19:16 +0800 |
commit | e435283c0ffe437f35898f92dc5572c8df83163e (patch) | |
tree | aa612897c0306fd75728c528638d4b32f781d4e6 /models | |
parent | cd99540cdcb38f53c7329218d3a21ed974f520c2 (diff) | |
download | gitea-e435283c0ffe437f35898f92dc5572c8df83163e.tar.gz gitea-e435283c0ffe437f35898f92dc5572c8df83163e.zip |
Don't select join table's columns (#19660)
* Don't select join table
* Add comment
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go index efbe243bed..7055ce81d6 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`.*"). // this line will avoid select other joined table's columns + Join("INNER", "repository", "`repository`.id = `action`.repo_id") opts.SetDefaultValues() sess = db.SetSessionPagination(sess, &opts) |