mirror of
https://github.com/friendica/friendica
synced 2025-04-29 15:04:22 +02:00
The thread table is replaced by post-thread and post-thread-user
This commit is contained in:
parent
e561cad844
commit
5e846dd7c2
13 changed files with 358 additions and 153 deletions
|
@ -194,7 +194,7 @@ class Post
|
|||
'parent-guid', 'parent-network', 'parent-author-id', 'parent-author-link', 'parent-author-name',
|
||||
'parent-author-network', 'signed_text', 'language', 'raw-body'], Item::DISPLAY_FIELDLIST, Item::ITEM_FIELDLIST);
|
||||
|
||||
if ($view == 'post-thread-view') {
|
||||
if ($view != 'post-view') {
|
||||
$selected = array_merge($selected, ['ignored', 'iid']);
|
||||
}
|
||||
}
|
||||
|
@ -448,6 +448,18 @@ class Post
|
|||
$affected = max($affected, DBA::affectedRows());
|
||||
}
|
||||
|
||||
$update_fields = DBStructure::getFieldsForTable('post-thread', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$rows = DBA::selectToArray('post-view', ['uri-id'], $condition, ['group_by' => ['uri-id']]);
|
||||
$uriids = array_column($rows, 'uri-id');
|
||||
if (!DBA::update('post-thread', $update_fields, ['uri-id' => $uriids])) {
|
||||
DBA::rollback();
|
||||
Logger::notice('Updating post-thread failed', ['fields' => $update_fields, 'condition' => $condition]);
|
||||
return false;
|
||||
}
|
||||
$affected = max($affected, DBA::affectedRows());
|
||||
}
|
||||
|
||||
$update_fields = DBStructure::getFieldsForTable('post-thread-user', $fields);
|
||||
if (!empty($update_fields)) {
|
||||
$rows = DBA::selectToArray('post-view', ['post-user-id'], $thread_condition);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue