mirror of
https://github.com/friendica/friendica
synced 2025-04-27 08:30:10 +00:00
Get rid of the "item" table, enhanced "post" tables
This commit is contained in:
parent
c918e83aa2
commit
ce6ad1aa73
23 changed files with 736 additions and 235 deletions
|
@ -47,13 +47,14 @@ class RemoveContact {
|
|||
$condition = ['uid' => $contact['uid'], 'contact-id' => $id];
|
||||
}
|
||||
do {
|
||||
$items = Post::select(['id', 'guid', 'uri-id', 'uid'], $condition, ['limit' => 100]);
|
||||
$items = Post::select(['id', 'post-user-id', 'uri-id', 'guid'], $condition, ['limit' => 100]);
|
||||
while ($item = Post::fetch($items)) {
|
||||
Logger::info('Delete removed contact item', ['id' => $item['id'], 'guid' => $item['guid']]);
|
||||
Logger::info('Delete removed contact item', ['id' => $item['id'], 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]);
|
||||
DBA::delete('item', ['id' => $item['id']]);
|
||||
Post\User::delete(['uri-id' => $item['uri-id'], 'uid' => $item['uid']]);
|
||||
Post::delete(['uri-id' => $item['uri-id']]);
|
||||
Post\ThreadUser::delete(['post-user-id' => $item['post-user-id']]);
|
||||
Post\Thread::delete(['uri-id' => $item['uri-id']]);
|
||||
Post\ThreadUser::delete(['uri-id' => $item['uri-id'], 'uid' => $item['uid']]);
|
||||
Post\User::delete(['id' => $item['post-user-id']]);
|
||||
}
|
||||
DBA::close($items);
|
||||
} while (Post::exists($condition));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue