From 40c33430163303039d7ab5b66af61756db2c8cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Niclas=20Oelschl=C3=A4ger?= Date: Mon, 4 Mar 2024 23:06:31 +0100 Subject: [PATCH] remove join --- models/issues/issue_list.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/models/issues/issue_list.go b/models/issues/issue_list.go index a354a5cb1f..c68235d24a 100644 --- a/models/issues/issue_list.go +++ b/models/issues/issue_list.go @@ -605,12 +605,11 @@ func (issues IssueList) BlockingDependenciesMap(ctx context.Context) (issueDepsM err = db.GetEngine(ctx). Table("issue"). - Join("INNER", "repository", "repository.id = issue.repo_id"). Join("INNER", "issue_dependency", "issue_dependency.issue_id = issue.id"). Where(builder.In("issue_dependency.dependency_id", issues.getIssueIDs())). - // sort by repo id then created date - Asc("issue.repo_id"). - Asc("issue.created_unix"). + // sort by repo id then index + Asc("`issue`.`repo_id`"). + Asc("`issue`.`index`"). Find(&issueDeps) if err != nil { return nil, err @@ -631,12 +630,11 @@ func (issues IssueList) BlockedByDependenciesMap(ctx context.Context) (issueDeps err = db.GetEngine(ctx). Table("issue"). - Join("INNER", "repository", "repository.id = issue.repo_id"). Join("INNER", "issue_dependency", "issue_dependency.dependency_id = issue.id"). Where(builder.In("issue_dependency.issue_id", issues.getIssueIDs())). - // sort by repo id then created date - Asc("issue.repo_id"). - Asc("issue.created_unix"). + // sort by repo id then index + Asc("`issue`.`repo_id`"). + Asc("`issue`.`index`"). Find(&issueDeps) if err != nil { return nil, err