-- tyl 宠物战力榜
CREATE TABLE `pet_power_rank` (
  `pet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '宠物id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `role_pet_power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '今日最高宠物战力',
  `sum_power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '宠物总战力',
  `yest_role_id` bigint(20) unsigned NOT NULL COMMENT '昨日榜最高宠物战力玩家',
  `yest_sum_power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '宠物昨日总战力',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`pet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='宠物-游戏服战力排行榜';

CREATE TABLE `pet_power_center_rank` (
  `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区id',
  `pet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '宠物id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `sex` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `role_name` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '角色名',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器号',
  `vip` mediumint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'vip',
  `sup_vip` mediumint(5) unsigned NOT NULL DEFAULT '0' COMMENT '贵族',
  `dress_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '头像框',
  `photo_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '头像',
  `sum_power` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '宠物总战力',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间戳',
  PRIMARY KEY (`zone_id`,`pet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT COMMENT='宠物-跨服分区宠物战力榜';

ALTER TABLE role_pet ADD COLUMN `old_power` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '旧战力' AFTER `is_awaken`;
