-- 跨服国战

CREATE TABLE `guild_cgwar_room` (
  `guild_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮派Id',
  `room` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '房间',
  PRIMARY KEY (`guild_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='跨服国战可参与社团(合服保留主服)';

CREATE TABLE `cross_guild_war_guild_info` (
  `guild_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮派Id',
  `server_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '游戏服ServerId',
  `server_num` int(11) unsigned NOT NULL DEFAULT '1' COMMENT '服务器编号(玩家可见的服编号)',
  `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  `room_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '房间Id',
  `guild_name` varchar(100) NOT NULL DEFAULT '' COMMENT '帮派名称',
  `guild_power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮派战力',
  `chief_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮主Id',
  `chief_name` varchar(50) NOT NULL DEFAULT '' COMMENT '帮主名称',
  `chief_power` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '帮主战力',
  `sign_ups` varchar(6000) NOT NULL DEFAULT '[]' COMMENT '报名列表',
  `supports` text NOT NULL COMMENT '支援列表',
  `support_num` int(11) NOT NULL DEFAULT '0' COMMENT '支援人数',
  PRIMARY KEY (`guild_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='跨服帮战-参战(报名)帮派信息(在跨服中使用-保留主跨服的)';

CREATE TABLE `cross_guild_war_last_zone` (
  `server_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '游戏服ServerId',
  `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  PRIMARY KEY (`server_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='跨服帮战-上一次分区信息(在跨服中使用-保留主跨服的)';

CREATE TABLE `cross_guild_war_city_info` (
  `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  `room_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '房间Id',
  `city_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '城池Id',
  `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏服ServerId',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏服编号(玩家看到的服数)',
  `guild_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮派Id',
  `guild_name` varchar(50) NOT NULL DEFAULT '' COMMENT '帮派名称',
  `guild_power` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '帮派战力',
  `chief_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '帮主Id',
  `chief_name` varchar(50) NOT NULL DEFAULT '' COMMENT '帮主名称',
  `chief_power` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '帮主战力',
  PRIMARY KEY (`zone_id`,`room_id`,`city_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='跨服帮战-城池占领信息(在跨服中使用-保留主跨服的)';


CREATE TABLE `cross_guild_war_role` (
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `support_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '应援次数',
  `use_free_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已使用免费应援次数',
  `support_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最近一次应援时间戳',
  `city_award` varchar(100) NOT NULL DEFAULT '[]' COMMENT '领取占领城池奖励记录[CityId]',
  `award_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最近一次领取占领城池奖励时间戳',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='跨服帮战-角色相关数据(保存在游戏服-合服时保留合并数据)';
