Added cron task to synchronise post forum ids after moving.

This commit is contained in:
flash 2018-12-30 04:27:42 +01:00
parent c025a2c88e
commit e1e84c43c0

View file

@ -159,6 +159,14 @@ if (PHP_SAPI === 'cli') {
ON t.`topic_id` = tt.`topic_id`
WHERE t.`topic_bumped` < NOW() - INTERVAL 1 MONTH
');
// Synchronise forum_id
db_exec('
UPDATE `msz_forum_posts` AS p
INNER JOIN `msz_forum_topics` AS t
ON t.`topic_id` = p.`topic_id`
SET p.`forum_id` = t.`forum_id`
');
break;
case 'migrate':