-- Deploy gaia:api_2020_08_07_add_skin_result_tag to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_skin_result_tag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT 'id',
    `result_id` integer NOT NULL COMMENT '测肤结果id',
    `tag_id` integer NOT NULL COMMENT 'tag_v3 id'
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment='测肤结果与标签的关系表';
ALTER TABLE `api_skin_result_tag` ADD INDEX `idx_api_skin_result_tag_a25dd9c8` (`result_id`);

ALTER TABLE `api_skin_face_result` ADD COLUMN `tractate_id` integer  NOT NULL DEFAULT 0 COMMENT '用户帖子 id',
ADD COLUMN `forehead_wrinkle_raw` integer  NOT NULL DEFAULT 0 COMMENT '抬头纹 旷世输出值',
ADD COLUMN `crows_feet_raw` integer  NOT NULL DEFAULT 0 COMMENT '鱼尾纹 旷世输出值',
ADD COLUMN `wrinkles_raw` integer  NOT NULL DEFAULT 0 COMMENT '法令纹 旷世输出值',
ADD COLUMN `acne_raw` integer  NOT NULL DEFAULT 0 COMMENT '痘痘 旷世输出值',
ADD COLUMN `version` integer  NOT NULL DEFAULT 1 COMMENT '数据版本';

COMMIT;
