Skip to content

Instantly share code, notes, and snippets.

@plcosta
Last active September 14, 2017 15:34
Show Gist options
  • Save plcosta/97584303174fe2561440ffe1df37eb2e to your computer and use it in GitHub Desktop.
Save plcosta/97584303174fe2561440ffe1df37eb2e to your computer and use it in GitHub Desktop.
Move Discourse Topics from one category to another
-- 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