Skip to content

Commit e435283

Browse files
authored
Don't select join table's columns (#19660)
* Don't select join table * Add comment
1 parent cd99540 commit e435283

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/action.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) {
340340
}
341341

342342
e := db.GetEngine(ctx)
343-
sess := e.Where(cond).Join("INNER", "repository", "`repository`.id = `action`.repo_id")
343+
sess := e.Where(cond).
344+
Select("`action`.*"). // this line will avoid select other joined table's columns
345+
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
344346

345347
opts.SetDefaultValues()
346348
sess = db.SetSessionPagination(sess, &opts)

0 commit comments

Comments
 (0)