aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-16 23:33:03 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-16 23:33:03 +0200
commit0da5e3bee9567138431d097aa1a4bea6d1fe2281 (patch)
tree1b7bb42f033da5bf9abfd930943f21cb0c13091f
parent659c2e14b8eff6a899c141bbd3793e8ca3aca02a (diff)
parent3d1a07f8f066461b58d2b04f4b4dba900556f430 (diff)
downloadforums-0da5e3bee9567138431d097aa1a4bea6d1fe2281.tar
forums-0da5e3bee9567138431d097aa1a4bea6d1fe2281.tar.gz
forums-0da5e3bee9567138431d097aa1a4bea6d1fe2281.tar.bz2
forums-0da5e3bee9567138431d097aa1a4bea6d1fe2281.tar.xz
forums-0da5e3bee9567138431d097aa1a4bea6d1fe2281.zip
Merge pull request #2318 from prototech/ticket/12121
[ticket/12121] Preserve link redirect counts when updating from 3.0.x. * prototech/ticket/12121: [ticket/12121] Preserve link redirect counts when updating from 3.0.x.
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_p1.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
index d5da54b888..10243dc77f 100644
--- a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
@@ -149,6 +149,15 @@ class softdelete_p1 extends \phpbb\db\migration\migration
$limit = 10;
$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
FROM ' . $this->table_prefix . 'topics
GROUP BY forum_id, topic_visibility