summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-19 04:39:48 +0200
committerGitHub <noreply@github.com>2020-04-19 10:39:48 +0800
commit245d6ebda5ab89eb84d99c803c6d50f67cc6147e (patch)
tree0b66c695a806bd8500b63ca46326374274ccd012 /models/repo.go
parentd9875ff2e1af91a1d73cd99ee5869aedf7fa0703 (diff)
downloadgitea-245d6ebda5ab89eb84d99c803c6d50f67cc6147e.tar.gz
gitea-245d6ebda5ab89eb84d99c803c6d50f67cc6147e.zip
On Repo Deletion: Delete related TrackedTimes too (#11110) (#11125)
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index 7e2cfd947f..b5a9395ede 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1968,6 +1968,11 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
return err
}
+ if _, err = sess.In("issue_id", deleteCond).
+ Delete(&TrackedTime{}); err != nil {
+ return err
+ }
+
attachments = attachments[:0]
if err = sess.Join("INNER", "issue", "issue.id = attachment.issue_id").
Where("issue.repo_id = ?", repoID).