mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 16:14:26 +02:00
We now don't store in the "item" table anymore
This commit is contained in:
parent
36357e790e
commit
e1c79a41d9
7 changed files with 275 additions and 497 deletions
|
@ -25,6 +25,7 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
@ -47,7 +48,9 @@ class Expire
|
|||
$rows = Post::select(['item-id', 'guid', 'uri-id', 'uid'], $condition);
|
||||
while ($row = Post::fetch($rows)) {
|
||||
Logger::info('Delete expired item', ['id' => $row['item-id'], 'guid' => $row['guid']]);
|
||||
DBA::delete('item', ['id' => $row['item-id']]);
|
||||
if (DBStructure::existsTable('item')) {
|
||||
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']]);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\User;
|
||||
|
||||
|
@ -64,7 +65,9 @@ class ExpireAndRemoveUsers
|
|||
// It seems that sometimes the system wants to delete the records in the wrong order.
|
||||
// So when the permissionset is deleted and these tables are still filled then an error is thrown.
|
||||
// So we now delete them before all other user related entries are deleted.
|
||||
DBA::delete('item', ['uid' => $user['uid']]);
|
||||
if (DBStructure::existsTable('item')) {
|
||||
DBA::delete('item', ['uid' => $user['uid']]);
|
||||
}
|
||||
DBA::delete('post-user', ['uid' => $user['uid']]);
|
||||
DBA::delete('profile_field', ['uid' => $user['uid']]);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Worker;
|
|||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
|
@ -50,7 +51,9 @@ class RemoveContact {
|
|||
$items = Post::select(['item-id', 'post-user-id', 'uri-id', 'guid'], $condition, ['limit' => 100]);
|
||||
while ($item = Post::fetch($items)) {
|
||||
Logger::info('Delete removed contact item', ['id' => $item['item-id'], 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]);
|
||||
DBA::delete('item', ['id' => $item['item-id']]);
|
||||
if (DBStructure::existsTable('item')) {
|
||||
DBA::delete('item', ['id' => $item['item-id']]);
|
||||
}
|
||||
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']]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue