-- liushl
-- 靓丽大赛重制
DROP TABLE IF EXISTS beauty_contest_data;
DROP TABLE IF EXISTS beauty_contest_vote_log;

CREATE TABLE `beauty_contest_role_local` (
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
  `contest_data` varchar(255) NOT NULL DEFAULT '' COMMENT '参赛数据',
  `vote` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '票数',
  `pick_counts` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '挑选次数',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '投票时间',

  `origin_rank` tinyint(8) unsigned NOT NULL DEFAULT '0' COMMENT '初始排名',
  `rank` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '最后排名',
  `stage` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '最后阶段',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='靓丽大赛-参赛个人数据本服(合服保留主服数据)';

DROP TABLE IF EXISTS beauty_contest_log;
CREATE TABLE `beauty_contest_log` (
  `rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
  `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器号',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名称',
  `lv` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '等级',
  `sex` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `vip` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'vip等级',
  `sup_vip` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '贵族',
  `career` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '职业',
  `turn` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '转职',
  `picture` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '头像',
  `picture_dress` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '头像装扮',
  `contest_data` varchar(255) NOT NULL DEFAULT '' COMMENT '参赛数据',

  `origin_rank` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '初始排名',
  `stage` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '最后阶段',
  PRIMARY KEY (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='靓丽大赛-上期数据(合服保留主服数据)';

ALTER TABLE beauty_contest_sign DROP COLUMN `data_change`;
ALTER TABLE beauty_contest_sign DROP COLUMN `stage`;
ALTER TABLE beauty_contest_sign DROP COLUMN `vote`;

ALTER TABLE beauty_contest_role DROP COLUMN `vote_stage`;
ALTER TABLE beauty_contest_role DROP COLUMN `vote_add_up`;
ALTER TABLE beauty_contest_role ADD COLUMN `vote` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '票数' AFTER `contest_data`;
ALTER TABLE beauty_contest_role ADD COLUMN `origin_rank` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '初始排名' AFTER `rank`;
ALTER TABLE beauty_contest_role ADD COLUMN `fashion_num` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '时装数量' AFTER `origin_rank`;
ALTER TABLE beauty_contest_role ADD COLUMN `lv` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '等级' AFTER `name`;

-- tyl 全民动员奖励日志
ALTER TABLE log_mobilize_award ADD COLUMN `end_day` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '结束天数' AFTER `day`;