DEV: Skip notifications without topic_id in ensure_consistency (#16299)

This commit is contained in:
Mark VanLandingham
2022-03-30 09:56:35 -05:00
committed by GitHub
parent 2e77cc86fc
commit b974375239
2 changed files with 3 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ class Notification < ActiveRecord::Base
DELETE
FROM notifications n
WHERE high_priority
AND notification_type NOT IN (#{types[:chat_mention].to_i}, #{types[:chat_message].to_i})
AND n.topic_id IS NOT NULL
AND NOT EXISTS (
SELECT 1
FROM posts p