Skip to content

Instantly share code, notes, and snippets.

@plcosta plcosta/query.sql
Last active Sep 14, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.