-- 创建分镜视频任务表
CREATE TABLE IF NOT EXISTS storyboard_video_tasks (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    task_id VARCHAR(50) NOT NULL UNIQUE,
    username VARCHAR(100) NOT NULL,
    prompt TEXT,
    image_url VARCHAR(500),
    aspect_ratio VARCHAR(10) NOT NULL,
    hd_mode BOOLEAN NOT NULL DEFAULT FALSE,
    status VARCHAR(20) NOT NULL,
    progress INT NOT NULL DEFAULT 0,
    result_url VARCHAR(500),
    real_task_id VARCHAR(255),
    error_message TEXT,
    cost_points INT NOT NULL DEFAULT 0,
    created_at TIMESTAMP NOT NULL,
    updated_at TIMESTAMP NOT NULL,
    completed_at TIMESTAMP,
    INDEX idx_username (username),
    INDEX idx_status (status),
    INDEX idx_task_id (task_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
