-- Deploy gaia:2020_07_21_create_plastic_4.0 to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `cheek_style_classify` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(64) NOT NULL DEFAULT '' COMMENT '类别名称',
    `rank` int(11) NOT NULL  DEFAULT 999999 COMMENT '类别排序',
    `is_online` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否在线',
    `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
);

CREATE INDEX `cheek_style_classify_890e9218` ON `cheek_style_classify` (`rank`);


CREATE TABLE `cheek_style_classify_map` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `cheek_style_classify_id` integer NOT NULL DEFAULT 0 COMMENT '类别id',
    `cheek_style_id` int(11) NOT NULL COMMENT '模板idid',
    `sort_type` tinyint(4) NOT NULL  DEFAULT 1 COMMENT '排序类型',
    `is_online` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否在线',
    `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
);


CREATE TABLE `cheek_style_extra` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `cheek_style_id` int(11) NOT NULL COMMENT '模板idid',
    `desc` varchar(64) NOT NULL DEFAULT '' COMMENT '描述文案',
    `analyze` varchar(64) NOT NULL DEFAULT '' COMMENT '分析文案',
    `is_online` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否在线',
    `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
);


CREATE TABLE `cheek_style_appeal_extra` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `cheek_style_id` int(11) NOT NULL COMMENT '模板idid',
    `appeal_tag_name` varchar(32) NOT NULL DEFAULT '' COMMENT '诉求标签名称',
    `desc` varchar(64) NOT NULL DEFAULT '' COMMENT '诉求文案',
    `is_online` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否在线',
    `deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
);

CREATE INDEX `cheek_style_extra_8ce11ad4` ON `cheek_style_extra` (`cheek_style_id`);

COMMIT;
