diff --git a/models/repo.go b/models/repo.go index 7e2cfd947fc5e..b5a9395ede46d 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).