-- 2020-08-20

-- tyl 修改快速充值日志表
DROP TABLE IF EXISTS `log_quickcharge`;
CREATE TABLE `log_quickcharge` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `product_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品Id',
  `gold` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '金币数',
  `money_gap` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '充值前金币差额',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '充值时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='快速充值日志';


-- hh
-- 单笔充值辅助数据

CREATE TABLE `role_single_charge`(
    `role_id` bigint(20) UNSIGNED NOT NULL COMMENT '人物id',
    `subtype` int(11) UNSIGNED NOT NULL COMMENT '活动子类型',
    `grade_id` smallint(5) UNSIGNED NOT NULL COMMENT '档次id',
    `receive_count` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已领取次数',
    `total_count` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '档次总次数',
    `time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '时间',
    PRIMARY KEY(`role_id`, `subtype`, `grade_id`),
    INDEX(`subtype`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="人物单笔充值辅助数据";


-- zmh
-- 进阶皮肤升级
CREATE TABLE `log_foster_skin_upgrade` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `name` varchar(100) NOT NULL COMMENT '角色名',
  `type` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '系统类型',
  `opty` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型',
  `skinid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '珍宝ID',
  `bef_star` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前星级',
  `aft_star` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '后星级',
  `costs` varchar(500)  NOT NULL DEFAULT '[]' COMMENT '花费',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='进阶皮肤升级日志';

-- huanyongxing
CREATE TABLE `role_treasure_house` (
  `id` bigint(20) NOT NULL COMMENT '角色id',
  `period` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '期数（数据归属）',
  `round` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '当前轮次（真实，前端显示的是转换后数据）',
  `count` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '当前轮次抽奖次数',
  `recv_round` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '未领完奖励的轮次（真实，前端显示的是转换后数据）',
  `data` varchar(600) NOT NULL DEFAULT '[]' COMMENT '当前在领轮次已领取的奖励次数档次+角色任务数据',
  `time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '数据时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色珍宝阁数据';


ALTER TABLE `log_foster_equip`
ADD COLUMN `grade`  int(11) NOT NULL DEFAULT 0 COMMENT '阶位' AFTER `type`;
