Skip to content

Commit

Permalink
On Repo Deletion: Delete related TrackedTimes too (#11110) (#11125)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored Apr 19, 2020
1 parent d9875ff commit 245d6eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 245d6eb

Please sign in to comment.