-- ================================================================
-- Migration: 011_youtube_live_support.sql
-- Description: Add YouTube live streaming support to live classes
-- Date: 2026-01-11
-- ================================================================

-- Add stream_type column to support YouTube and Jitsi
ALTER TABLE `live_classes` 
ADD COLUMN `stream_type` ENUM('jitsi', 'youtube') NOT NULL DEFAULT 'jitsi' 
COMMENT 'Type of live stream: jitsi for interactive calls, youtube for one-way streaming'
AFTER `jitsi_room_password`;

-- Add youtube_url column for YouTube live stream URL (separate column for cleaner design)
ALTER TABLE `live_classes`
ADD COLUMN `youtube_url` VARCHAR(500) DEFAULT NULL 
COMMENT 'YouTube live stream URL (unlisted) - used when stream_type is youtube'
AFTER `stream_type`;

-- Add Socket.IO room ID for YouTube chat (optional - for tracking)
ALTER TABLE `live_classes`
ADD COLUMN `socket_room_id` VARCHAR(100) DEFAULT NULL 
COMMENT 'Socket.IO room identifier for real-time chat'
AFTER `youtube_url`;

-- Verify changes
DESCRIBE `live_classes`;
