-- ============================================================================
-- Migration: Add 'welcome' module type and update existing welcome module
-- ============================================================================
-- Date: December 14, 2024
-- Description: Updates the modules table to support 'welcome' type and fixes
--              the Boxing Day 2026 Welcome module to use the correct type
-- ============================================================================

USE ianntest_boxingday;

-- Step 1: Update the modules table to include 'welcome' as a valid type
ALTER TABLE modules 
MODIFY type ENUM('welcome', 'game_card', 'interactive', 'timer', 'leaderboard', 'jeopardy') NOT NULL;

-- Step 2: Update the Boxing Day 2026 Welcome module to use 'welcome' type
UPDATE modules 
SET type = 'welcome' 
WHERE slug = 'welcome-2026';

-- Step 3: Verify the changes
SELECT id, slug, name, type, is_active 
FROM modules 
WHERE slug = 'welcome-2026';

-- ============================================================================
-- Notes:
-- - This adds 'welcome' as the first option in the ENUM
-- - The existing 'welcome-2026' module will now render correctly
-- - All other modules remain unchanged
-- ============================================================================