UPDATE rh_modules
   SET state = 'enabled',
       reason = 'Verified RootHVN utility release',
       updated_by = NULL
 WHERE module_slug = 'focus';

UPDATE rh_modules
   SET state = 'enabled',
       reason = 'Verified RootHVN creator-studio release',
       updated_by = NULL
 WHERE module_slug = 'publishing';

INSERT INTO forums (forum_name, forum_description, forum_color, forum_icon, forum_section, forum_order)
SELECT 'RootHVN Community', 'Purposeful discussions, questions and shared knowledge.', '#1b8a4f', 'leaf', 0, 1
 WHERE NOT EXISTS (SELECT 1 FROM forums);

SET @rh_forum_section_id = (
  SELECT forum_id
    FROM forums
   WHERE forum_section = 0
     AND forum_name = 'RootHVN Community'
   ORDER BY forum_id
   LIMIT 1
);

INSERT INTO forums (forum_name, forum_description, forum_color, forum_icon, forum_section, forum_order)
SELECT 'General Conversations', 'A welcoming place for useful questions and thoughtful conversation.', '#1b8a4f', 'messages', @rh_forum_section_id, 1
 WHERE @rh_forum_section_id IS NOT NULL
   AND NOT EXISTS (
     SELECT 1
       FROM forums
      WHERE forum_section = @rh_forum_section_id
        AND forum_name = 'General Conversations'
   );
