1
0
Fork 0

"id" is now post-user-id

This commit is contained in:
Michael 2021-02-14 18:33:15 +00:00
commit 36357e790e
9 changed files with 76 additions and 63 deletions

View file

@ -44,10 +44,10 @@ 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 = Post::select(['id', 'guid', 'uri-id', 'uid'], $condition);
$rows = Post::select(['item-id', 'guid', 'uri-id', 'uid'], $condition);
while ($row = Post::fetch($rows)) {
Logger::info('Delete expired item', ['id' => $row['id'], 'guid' => $row['guid']]);
DBA::delete('item', ['id' => $row['id']]);
Logger::info('Delete expired item', ['id' => $row['item-id'], 'guid' => $row['guid']]);
DBA::delete('item', ['id' => $row['item-id']]);
Post\User::delete(['uri-id' => $row['uri-id'], 'uid' => $row['uid']]);
Post\ThreadUser::delete(['uri-id' => $row['uri-id'], 'uid' => $row['uid']]);
}