-- Deploy gaia:2020_09_15_create_add_famous_doctor_field to mysql

BEGIN;

-- XXX Add DDLs here.
ALTER TABLE api_famous_doctors_registrationer ADD COLUMN `version` varchar(128) NOT NULL DEFAULT '000000' COMMENT '增加字段',ADD COLUMN `register_code` varchar(128) NOT NULL DEFAULT '0' COMMENT '注册编码';

CREATE TABLE api_famous_doctors_reward (
`id` INT AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT '主键',
`user_id` INT NOT NULL COMMENT '用户id',
`reward_type` INT NOT  NULL DEFAULT 1 COMMENT '奖励类型',
`create_time` DATETIME NOT NULL COMMENT '票数统计',
`reward` longtext   COMMENT '{"des":"描述", "prize": "奖励"}' ,
`version` VARCHAR(128) NOT NULL DEFAULT '000000' COMMENT '名医大赏版本（如202010）'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '名医大赏领奖表';

CREATE TABLE api_famous_doctors_canvass (
`id` INT AUTO_INCREMENT NOT NULL PRIMARY KEY COMMENT '主键',
`admin_user_id` INT NOT NULL COMMENT '后台管理员user_id',
`register_id` INT NOT NULL COMMENT '报名id',
`item_id` INT NOT NULL COMMENT '类目id',
`add_num` int NOT NULL DEFAULT 0 COMMENT '灌水票数',
`create_time` DATETIME NOT NULL COMMENT '创建时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '后台灌水记录表';

COMMIT;
