]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/RemoveContact.php
Prevent permissionset foreign key constraint
[friendica.git] / src / Worker / RemoveContact.php
index 6662e58a58201bbc91303534ed0a3f4cde6382d1..25d61f555597106379a40ba5cf390d1d0ecd22ba 100644 (file)
@@ -47,10 +47,11 @@ class RemoveContact {
                        $condition = ['uid' => $contact['uid'], 'contact-id' => $id];
                }
                do {
-                       $items = Post::select(['id', 'guid'], $condition, ['limit' => 100]);
+                       $items = Post::select(['id', 'guid', 'uri-id', 'uid'], $condition, ['limit' => 100]);
                        while ($item = Post::fetch($items)) {
                                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']]);
                        }
                        DBA::close($items);
                } while (Post::exists($condition));