We recently had to change the Video Games community to Gaming News and here is how we did it:
-- SELECT * FROM up_users WHERE campaign_reference = 'gaming-news';
UPDATE up_users SET campaign_reference = 'video-games' WHERE campaign_reference = 'gaming-news';
UPDATE posts SET body = replace(body, 'justabout.com/gaming-news', 'justabout.com/video-games');
UPDATE posts SET body = replace(body, 'Gaming News', 'Video Games');
/* Cant change "posts.preveiws" as its jsonb. There is only one post (id = 1632)
which has a preview containing "gaming-news" which needs manually updating */
-- SELECT * FROM threads WHERE title LIKE '%Gaming News%';
UPDATE threads SET title = replace(title, 'Gaming News', 'Video Games');
-- SELECT * FROM threads WHERE slug LIKE '%gaming-news%';
UPDATE threads SET slug = replace(slug, 'gaming-news', 'video-games');
UPDATE notifications SET subject = replace(subject, 'Gaming News', 'Video Games');
UPDATE emails SET text = replace(text, 'justabout.com/gaming-news', 'justabout.com/video-games');
next-app so the static pages get regenerated