-- zmh 社团派单
DROP TABLE if exists  `guild_order`;
CREATE TABLE `guild_order` (
  `id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家id',
  `cfgid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '配置',
  `status` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
  `content` varchar(500) NOT NULL DEFAULT '{}' COMMENT '任务内容',
  `teams` varchar(500) NOT NULL DEFAULT '{}' COMMENT '拼单人',
  `finish_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '完成时间',
  PRIMARY KEY (`id`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='社团派单-合服合并';


-- zmh 通用封榜相关
CREATE TABLE `vie_rank` (
  `act` int(11) unsigned DEFAULT '0' COMMENT '活动',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '玩家名字',
  `server_id` int(11) unsigned DEFAULT '0' COMMENT '服务器ID',
  `server_num` int(11) DEFAULT '0' COMMENT '服务器Num',
  `vip` int(11) unsigned DEFAULT '0' COMMENT 'vip',
  `svip` int(11) DEFAULT '0' COMMENT 'vip至尊',
  `score` int(11) unsigned DEFAULT '0' COMMENT '积分',
  `rtime` int(11) DEFAULT '0' COMMENT '数据更新时间',
  `dtime` int(11) DEFAULT '0' COMMENT '数据有效时间',
  PRIMARY KEY (`act`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='封榜合服保留';


CREATE TABLE `log_local_vie_rank` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `act` int(11) unsigned NOT NULL COMMENT '活动Id',
  `zone` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名字',
  `server_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '服务器Id(后台唯一服号)',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号(玩家可见的服编号)',
  `score` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分',
  `rank` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
  `rtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间戳',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '日志时间戳',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='封榜活动本地日志';


CREATE TABLE `log_vie_rank` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `act` int(11) unsigned NOT NULL COMMENT '活动Id',
  `zone` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区Id',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名字',
  `server_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '服务器Id(后台唯一服号)',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器编号(玩家可见的服编号)',
  `score` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '积分',
  `rank` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
  `rtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间戳',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '日志时间戳',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='封榜活动跨服日志';


CREATE TABLE `log_vie_score` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `act` int(11) unsigned NOT NULL COMMENT '活动Id',
  `rid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名字',
  `score_add` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '获得积分',
  `score_all` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总积分',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '日志时间戳',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='封榜积分获得日志';
