diff options
author | 6543 <6543@obermui.de> | 2020-04-18 23:39:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 22:39:23 +0100 |
commit | 4be7cf04054e5eab3b2cf4a63ad31a9333ab4732 (patch) | |
tree | b9546f1446790cc9bf4e86bc88409a99e814f248 /models | |
parent | 5180deb8199b851384c60fac5b78aac3c9b50a67 (diff) | |
download | gitea-4be7cf04054e5eab3b2cf4a63ad31a9333ab4732.tar.gz gitea-4be7cf04054e5eab3b2cf4a63ad31a9333ab4732.zip |
On Repo Deletion: Delete related TrackedTimes too (#11110)
Diffstat (limited to 'models')
-rw-r--r-- | models/repo.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go index a901c3476b..438066e0da 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1614,6 +1614,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). |