]> git.mxchange.org Git - friendica.git/commitdiff
Avoid foreign key problems when deleting contacts
authorMichael <heluecht@pirati.ca>
Fri, 5 Feb 2021 07:44:39 +0000 (07:44 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 5 Feb 2021 07:44:39 +0000 (07:44 +0000)
src/Worker/RemoveContact.php

index 25d61f555597106379a40ba5cf390d1d0ecd22ba..e1e6cbcf9fde572741f0dd30139b3a16cf0236e3 100644 (file)
@@ -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));