-- 为 user_day_statistics 表添加新字段的迁移脚本
-- 执行日期: 2026-01-28

USE media_manager;

-- 添加新字段
ALTER TABLE user_day_statistics
ADD COLUMN play_count INT DEFAULT 0 COMMENT '播放数' AFTER works_count,
ADD COLUMN comment_count INT DEFAULT 0 COMMENT '评论数' AFTER play_count,
ADD COLUMN fans_increase INT DEFAULT 0 COMMENT '涨粉数' AFTER comment_count,
ADD COLUMN like_count INT DEFAULT 0 COMMENT '点赞数' AFTER fans_increase,
ADD COLUMN cover_click_rate DECIMAL(10,4) DEFAULT 0 COMMENT '封面点击率' AFTER like_count,
ADD COLUMN avg_watch_duration DECIMAL(10,2) DEFAULT 0 COMMENT '平均观看时长（秒）' AFTER cover_click_rate,
ADD COLUMN total_watch_duration BIGINT DEFAULT 0 COMMENT '观看总时长（秒）' AFTER avg_watch_duration,
ADD COLUMN completion_rate DECIMAL(10,4) DEFAULT 0 COMMENT '视频完播率' AFTER total_watch_duration;
