Last active
September 14, 2017 15:34
-
-
Save plcosta/97584303174fe2561440ffe1df37eb2e to your computer and use it in GitHub Desktop.
Move Discourse Topics from one category to another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- cd /var/discourse | |
-- ./launcher enter app | |
-- su discourse | |
-- psql | |
-- MOVE TOPICS CATEGORY | |
-- CURRENT CATEGORY: 1 | |
-- NEW CATEGORY: 2 | |
UPDATE topics SET category_id = 2 WHERE category_id = 1; | |
UPDATE categories SET topic_count = 0, topics_year = 0, topics_month = 0, topics_week = 0, post_count = 0, latest_post_id = NULL, latest_topic_id = NULL, posts_year = 0, posts_month = 0, posts_week = 0, topics_day = 0, posts_day = 0 WHERE id = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment