mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 06:52:54 +00:00
Fix order by parameter (#19849)
Upgrade builder to v0.3.11 Upgrade xorm to v1.3.1 and fixed some hidden bugs. Replace #19821 Replace #19834 Included #19850 Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
449ea6005f
commit
12c742f8dc
19 changed files with 175 additions and 72 deletions
|
@ -86,7 +86,6 @@ func DeleteOrphanedIssueLabels() error {
|
|||
_, err := db.GetEngine(db.DefaultContext).
|
||||
NotIn("label_id", builder.Select("id").From("label")).
|
||||
Delete(IssueLabel{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -95,7 +94,8 @@ func CountOrphanedIssues() (int64, error) {
|
|||
return db.GetEngine(db.DefaultContext).Table("issue").
|
||||
Join("LEFT", "repository", "issue.repo_id=repository.id").
|
||||
Where(builder.IsNull{"repository.id"}).
|
||||
Count("id")
|
||||
Select("COUNT(`issue`.`id`)").
|
||||
Count()
|
||||
}
|
||||
|
||||
// DeleteOrphanedIssues delete issues without a repo
|
||||
|
@ -141,7 +141,8 @@ func CountOrphanedObjects(subject, refobject, joinCond string) (int64, error) {
|
|||
return db.GetEngine(db.DefaultContext).Table("`"+subject+"`").
|
||||
Join("LEFT", "`"+refobject+"`", joinCond).
|
||||
Where(builder.IsNull{"`" + refobject + "`.id"}).
|
||||
Count("id")
|
||||
Select("COUNT(`" + subject + "`.`id`)").
|
||||
Count()
|
||||
}
|
||||
|
||||
// DeleteOrphanedObjects delete subjects with have no existing refobject anymore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue