mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-10 17:14:26 +02:00
New "post-user" structure, new update functionality
This commit is contained in:
parent
a7791bebc2
commit
9a9674d5fb
8 changed files with 200 additions and 69 deletions
|
@ -27,6 +27,7 @@ use Friendica\Core\Worker;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
/**
|
||||
* Expires old item entries
|
||||
|
@ -43,10 +44,11 @@ class Expire
|
|||
Logger::log('Delete expired items', Logger::DEBUG);
|
||||
// physically remove anything that has been deleted for more than two months
|
||||
$condition = ["`deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY"];
|
||||
$rows = DBA::select('item', ['id', 'guid'], $condition);
|
||||
$rows = DBA::select('item', ['id', 'guid', 'uri-id', 'uid'], $condition);
|
||||
while ($row = DBA::fetch($rows)) {
|
||||
Logger::info('Delete expired item', ['id' => $row['id'], 'guid' => $row['guid']]);
|
||||
DBA::delete('item', ['id' => $row['id']]);
|
||||
Post\User::delete(['uri-id' => $row['uri-id'], 'uid' => $row['uid']]);
|
||||
}
|
||||
DBA::close($rows);
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue