mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
[ticket/12121] Preserve link redirect counts when updating from 3.0.x.
PHPBB3-12121
This commit is contained in:
parent
b305364b27
commit
3d1a07f8f0
1 changed files with 9 additions and 0 deletions
|
@ -149,6 +149,15 @@ class softdelete_p1 extends \phpbb\db\migration\migration
|
||||||
$limit = 10;
|
$limit = 10;
|
||||||
$converted_forums = 0;
|
$converted_forums = 0;
|
||||||
|
|
||||||
|
if (!$start)
|
||||||
|
{
|
||||||
|
// Preserve the forum_posts value for link forums as it represents redirects.
|
||||||
|
$sql = 'UPDATE ' . $this->table_prefix . 'forums
|
||||||
|
SET forum_posts_approved = forum_posts
|
||||||
|
WHERE forum_type = ' . FORUM_LINK;
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
$sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved
|
$sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved
|
||||||
FROM ' . $this->table_prefix . 'topics
|
FROM ' . $this->table_prefix . 'topics
|
||||||
GROUP BY forum_id, topic_visibility
|
GROUP BY forum_id, topic_visibility
|
||||||
|
|
Loading…
Add table
Reference in a new issue