diff --git a/src/applications/system/engine/PhabricatorDestructionEngine.php b/src/applications/system/engine/PhabricatorDestructionEngine.php index c5b813169c..eddc2f73fb 100644 --- a/src/applications/system/engine/PhabricatorDestructionEngine.php +++ b/src/applications/system/engine/PhabricatorDestructionEngine.php @@ -116,13 +116,14 @@ final class PhabricatorDestructionEngine extends Phobject { } private function destroyNotifications($object_phid) { - $notifications = id(new PhabricatorFeedStoryNotification())->loadAllWhere( - 'primaryObjectPHID = %s', - $object_phid); + $table = id(new PhabricatorFeedStoryNotification()); + $conn_w = $table->establishConnection('w'); - foreach ($notifications as $notification) { - $notification->delete(); - } + queryfx( + $conn_w, + 'DELETE FROM %T WHERE primaryObjectPHID = %s', + $table->getTableName(), + $object_phid); } }