From 265f46692f42c6611283471c51f2e1b5e428c513 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 Feb 2021 07:44:39 +0000 Subject: [PATCH] Avoid foreign key problems when deleting contacts --- src/Worker/RemoveContact.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 25d61f555..e1e6cbcf9 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -52,6 +52,8 @@ class RemoveContact { Logger::info('Delete removed contact item', ['id' => $item['id'], 'guid' => $item['guid']]); DBA::delete('item', ['id' => $item['id']]); Post\User::delete(['uri-id' => $item['uri-id'], 'uid' => $item['uid']]); + Post\Thread::delete(['uri-id' => $item['uri-id']]); + Post\ThreadUser::delete(['uri-id' => $item['uri-id'], 'uid' => $item['uid']]); } DBA::close($items); } while (Post::exists($condition));