-- 指挥官数据
-- zmh
CREATE TABLE `legion_director`(
    `zone` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区ID',
    `fact` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '阵营',
    `pos` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '站位',
    `rid` bigint(20) UNSIGNED NOT NULL COMMENT '玩家id',
    `name` varchar(200) NOT NULL DEFAULT '[]' COMMENT '玩家名',
    `sex` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别',
    `career` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '职业',
    PRIMARY KEY(`zone`,`fact`,`pos`)
)ENGINE=InnoDb CHARSET=utf8 COMMENT="指挥官数据";

-- hh
-- 跨服团战相关修改

CREATE TABLE `camp_war_guild_rank_log`(
    `zone_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分区id',
    `fac_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '阵营id',
    `svr_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器id',
    `guild_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社团id',
    `svr_num` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '服务器编号',
    `guild_name` varchar(256) NOT NULL DEFAULT "" COMMENT '社团名称',
    `hurt` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '伤害数值',
    PRIMARY KEY(`zone_id`, `fac_id`, `svr_id`, `guild_id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="跨服团战阵营社团排名数据";


ALTER TABLE `camp_war_guild_info` DROP COLUMN `chief_id`;

ALTER TABLE `camp_war_guild_info` DROP COLUMN `chief_name`;

ALTER TABLE `camp_war_guild_info` DROP COLUMN `chief_power`;

ALTER TABLE `camp_war_guild_info`
    ADD COLUMN `chief_info` varchar(1000) NOT NULL DEFAULT '[]' COMMENT '社团社长信息' AFTER `guild_power`;

-- 任命记录
-- 合服注意  A合到B  A B服的数据要清掉非自己server_num的数据
-- 之后再把数据合并
CREATE TABLE `legion_director_log`(
    `issue` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '期数',
    `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号',
    `pos`  int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '站位',
    `rid` bigint(20) UNSIGNED NOT NULL COMMENT '玩家id',
    `name` varchar(200) NOT NULL DEFAULT '[]' COMMENT '玩家名',
    `sex` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别',
    `career` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '职业',
    `turn` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '转生',
    `vip` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'vip',
    `sup_vip` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'svip',
    `picture` varchar(100) NOT NULL DEFAULT '' COMMENT '玩家上传的头像url',
    `picture_ver` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家上传的头像版本号',
    PRIMARY KEY(`issue`,`server_num`,`pos`)
)ENGINE=InnoDb CHARSET=utf8 COMMENT="任命记录";

-- 修改跨服团战排名表
DROP TABLE IF EXISTS `camp_war_fac_info`;
ALTER TABLE `camp_war_guild_rank_log`
    ADD COLUMN `chief_info` varchar(1000) NOT NULL DEFAULT '[]' COMMENT '社团社长信息' AFTER `hurt`;

-- 跑马道具使用
CREATE TABLE `log_glamour_item`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) NOT NULL COMMENT '玩家id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
  `runid` bigint(20) NOT NULL COMMENT '对方玩家id',
  `rname` varchar(255) NOT NULL DEFAULT '' COMMENT '对方角色名称',
  `item` bigint(20) NOT NULL COMMENT '物品',
  `ishit` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否中',
  `isfree` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否免费',
  `time` int(11) NOT NULL COMMENT '时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8  COMMENT = '跑马道具使用';


-- 投注结果
CREATE TABLE `log_glamour_like`  (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
    `role_id` bigint(20) NOT NULL COMMENT '玩家id',
    `name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
    `omoney` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '旧资金',
    `nmoney` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '新资金',
    `round` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '回合',
    `logs` varchar(600) NOT NULL DEFAULT '' COMMENT '投注记录',
    `time` int(11) NOT NULL COMMENT '时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8  COMMENT = '投注结果';


-- 资金投注排名
CREATE TABLE `log_glamour_rank`  (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
    `role_id` bigint(20) NOT NULL COMMENT '玩家id',
    `name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称',
    `rank` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '名次',
    `money` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '资金',
    `awards` varchar(600) NOT NULL DEFAULT '' COMMENT '奖励',
    `time` int(11) NOT NULL COMMENT '时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8  COMMENT = '资金投注排名';