-- 添加播课功能相关字段到 courses 表
-- 日期: 2025-10-14

USE kaopeilian;

-- 添加播课音频URL字段
ALTER TABLE courses 
ADD COLUMN broadcast_audio_url VARCHAR(500) NULL COMMENT '播课音频URL';

-- 添加播课生成时间字段
ALTER TABLE courses 
ADD COLUMN broadcast_generated_at DATETIME NULL COMMENT '播课生成时间';

-- 验证字段添加
SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_COMMENT 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_SCHEMA = 'kaopeilian' 
  AND TABLE_NAME = 'courses' 
  AND COLUMN_NAME IN ('broadcast_audio_url', 'broadcast_generated_at');

