aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/issue.go1
-rw-r--r--models/issue_comment.go2
2 files changed, 2 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index ed94195ed1..53ee585dc0 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -2124,6 +2124,7 @@ func deleteIssue(ctx context.Context, issue *Issue) error {
&IssueDependency{},
&IssueAssignees{},
&IssueUser{},
+ &Notification{},
&Reaction{},
&IssueWatch{},
&Stopwatch{},
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 0af45e80e8..8390d90f8a 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -1163,7 +1163,7 @@ func deleteComment(e db.Engine, comment *Comment) error {
}
if comment.Type == CommentTypeComment {
- if _, err := e.Exec("UPDATE `issue` SET num_comments = num_comments - 1 WHERE id = ?", comment.IssueID); err != nil {
+ if _, err := e.ID(comment.IssueID).Decr("num_comments").Update(new(Issue)); err != nil {
return err
}
}