CREATE TABLE IF NOT EXISTS `la_ai_comment_task` (
  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
  `target_type` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '目标类型 article/post',
  `target_id` BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '目标内容ID',
  `virtual_user_id` BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '虚拟账号ID',
  `persona_key` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '人设标识',
  `selection_sources` TEXT NULL COMMENT '来源集合',
  `comment_content` TEXT NULL COMMENT '评论正文',
  `status` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态 0-待执行 1-成功 2-失败',
  `error_msg` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '错误信息',
  `create_time` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_time` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_target_status` (`target_type`, `target_id`, `status`) USING BTREE,
  KEY `idx_virtual_user` (`virtual_user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Docker AI评论任务表';
