-- tyl 废土战场日志
CREATE TABLE `log_wasteland_war` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器Id(后台唯一服号)',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号(玩家可见服编号)',
  `kf_grade` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '跨服阶段',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '类型(1-玩家进入场景；2-假人进入场景；3-玩家替换假人 4-主动退出场景；5-淘汰被踢出场景；6-活动结束退出场景)',
  `round` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '当前轮数',
  `rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '积分排名',
  `score` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `type` (`type`) USING BTREE,
  KEY `time` (`time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='废土战场参与日志';

-- 舞池派对日志
drop table if exists log_charm_beach,log_charm_beach_charmv,log_charm_beach_exp;
CREATE TABLE `log_beach_rank` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `room` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '房间',
  `line_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分线',
  `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器Id',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号(玩家可见)',
  `kf_grade` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '跨服阶段',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `vip_lv` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'vip等级',
  `power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '战力',
  `votes` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当前投票',
  `rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
  `reward` varchar(255) NOT NULL DEFAULT '[]' COMMENT '排名奖励',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `server_num` (`server_num`) USING BTREE,
  KEY `time` (`time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='舞池派对排名日志表';

CREATE TABLE `log_beach_vote` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `room` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '房间',
  `line_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分线',
  `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器id',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `dancer_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '舞者id',
  `dancer_name` varchar(255) NOT NULL DEFAULT '' COMMENT '舞者名称',
  `left_free_votes` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '剩余免费次数',
  `exp_reward` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '经验奖励',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `server_num` (`server_num`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='舞池派对投票日志';

-- 社团竞速日志
CREATE TABLE `log_guild_race_rank_guild` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `guild_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '公会Id',
  `guild_name` varchar(255) NOT NULL DEFAULT '' COMMENT '公会名称',
  `power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '公会总战力',
  `guild_rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '公会排名',
  `open_day` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '开服天数',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `guild_id` (`guild_id`) USING BTREE,
  KEY `guild_name` (`guild_name`) USING BTREE,
  KEY `open_day` (`open_day`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='社团竞速社团排名日志表';

CREATE TABLE `log_guild_race_rank_role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `guild_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '公会id',
  `guild_rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '公会排名',
  `power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '个人战力',
  `role_rank` smallint(5) unsigned NOT NULL COMMENT '个人排名',
  `open_day` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '开服天数',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `open_day` (`open_day`) USING BTREE,
  KEY `time` (`time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='社团竞速个人排名日志表';

-- 宠物副本排行榜日志
CREATE TABLE `log_dun_pet_rank_reward` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `score` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分',
  `rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `time` (`time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='宠物副本排行榜日志表';


-- 星辰槽位解锁日志
CREATE TABLE `log_galaxy_pos` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `type` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '槽位类型',
  `pos` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '槽位',
  `cost` varchar(255) NOT NULL DEFAULT '[]' 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='星辰槽位解锁日志';

-- 星辰上阵日志
CREATE TABLE `log_galaxy_equip` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `type` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '槽位类型',
  `pos` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '槽位',
  `old_item` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '旧道具',
  `new_item` 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='星辰上阵日志';


-- 星辰改造日志
CREATE TABLE `log_galaxy_change` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `opty` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型',
  `item` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '道具',
  `old_lv` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '旧等级',
  `new_lv` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '新等级',
  `cost` varchar(500) NOT NULL DEFAULT '[]' COMMENT '消耗列表',
  `gain` varchar(500) NOT NULL DEFAULT '[]' 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='星辰改造日志';

-- 星辰皮肤日志
CREATE TABLE `log_galaxy_skin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `skin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '皮肤',
  `cost` varchar(200) NOT NULL DEFAULT '[]' COMMENT '消耗列表',
  `old_star` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '旧等级',
  `new_star` 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='星辰皮肤日志';

-- 幻光激活升级
CREATE TABLE `log_visus_upgrade` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `opty` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型0激活1升级',
  `visus` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '幻光',
  `old_star` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '旧等级',
  `new_star` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '新等级',
  `cost` varchar(200) NOT NULL DEFAULT '[]' COMMENT '消耗列表',
  `condition` varchar(200) NOT NULL DEFAULT '[]' 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='幻光激活升级';

-- 经验副本日志
CREATE TABLE `log_exp_dun`(
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '序号',
    `role_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '玩家id',
    `power` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '战力',
    `chapter` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '章节',
    `wave` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '波数',
    `exp_ratio` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '挑战后每分钟收益',
    `result_type` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '挑战类型',
    `exp` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '获得经验',
    `time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '时间',
    PRIMARY KEY(`id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="经验副本日志";


-- 跨服团战日志
CREATE TABLE `log_camp_war_rank_guild`(
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '序号',
    `zone_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分区ID',
    `server_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器ID',
    `server_num` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器编号',
    `guild_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社团ID',
    `guild_name` varchar(256) NOT NULL DEFAULT "" COMMENT '社团名',
    `fighter` varchar(500) NOT NULL DEFAULT '[]' COMMENT '对手社团ID',
    `guild_rank` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社团伤害排名',
    `time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '结算时间',
    PRIMARY KEY(`id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="跨服团战社团伤害排名";


-- 跨服团战个人排行日志
CREATE TABLE `log_camp_war_rank_role`(
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '序号',
    `zone_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分区id',
    `server_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器id',
    `server_num` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器编号',
    `role_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '玩家id',
    `guild_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社团id',
    `mirror` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0否|1是',
    `rank` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '个人排名',
    `time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '结算时间',
    PRIMARY KEY(`id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="跨服团战个人排名日志";

-- 社团采集日志
CREATE TABLE `log_guild_collect`(
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '序号',
    `role_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '玩家id',
    `guild_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社团id',
    `round_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '本场剩余可封印次数',
    `today_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '今日剩余可封印次数',
    `rewards` varchar(256) NOT NULL DEFAULT '[]' COMMENT '奖励',
    `time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '封印采集时间',
    PRIMARY KEY(`id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="社团采集日志";