Avoid foreign key problems when deleting contacts

This commit is contained in:
Michael 2021-02-05 07:44:39 +00:00
parent 45dedee0a2
commit 265f46692f
1 changed files with 2 additions and 0 deletions

View 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));