File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ func CountOrphanedIssues() (int64, error) {
95
95
return db .GetEngine (db .DefaultContext ).Table ("issue" ).
96
96
Join ("LEFT" , "repository" , "issue.repo_id=repository.id" ).
97
97
Where (builder.IsNull {"repository.id" }).
98
- Count ("id" )
98
+ Select ("COUNT(`issue`.`id`)" ).
99
+ Count ()
99
100
}
100
101
101
102
// DeleteOrphanedIssues delete issues without a repo
@@ -140,8 +141,9 @@ func DeleteOrphanedIssues() error {
140
141
func CountOrphanedObjects (subject , refobject , joinCond string ) (int64 , error ) {
141
142
return db .GetEngine (db .DefaultContext ).Table ("`" + subject + "`" ).
142
143
Join ("LEFT" , "`" + refobject + "`" , joinCond ).
143
- Where (builder.IsNull {"`" + refobject + "`.id" }).
144
- Count ("id" )
144
+ Where (builder.IsNull {"`" + refobject + "`.`id`" }).
145
+ Select ("COUNT(`" + subject + "`.`id`)" ).
146
+ Count ()
145
147
}
146
148
147
149
// DeleteOrphanedObjects delete subjects with have no existing refobject anymore
@@ -241,7 +243,6 @@ func FixIssueLabelWithOutsideLabels() (int64, error) {
241
243
WHERE
242
244
(label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != repository.owner_id)
243
245
) AS il_too )` )
244
-
245
246
if err != nil {
246
247
return 0 , err
247
248
}
You can’t perform that action at this time.
0 commit comments