-- liushl
CREATE TABLE `beauty_contest_data`(
    `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器id',
    `open_zones` varchar(2000) NOT NULL DEFAULT '[]' COMMENT '当前开放的分区',
    `round` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '轮次，每次开启+1',
    `begin_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '轮次开始时间',
    `end_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '轮次结束时间',
    `stage` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '活动阶段',
    `stage_begin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '阶段开始时间',
    `stage_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '阶段结束时间',
    PRIMARY KEY(`server_id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="靓丽大赛-活动数据(合服保留)";

CREATE TABLE `beauty_contest_role`(
    `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
    `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区id',
    `server_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器id',
    `server_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '服务器id',
    `name` varchar(50) NOT NULL DEFAULT '' 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 '参赛数据',
    `vote_stage` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当前票数',
    `vote_add_up` 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 '投票时间',
    `stage` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '最后阶段',
    `rank` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排名',
    PRIMARY KEY(`role_id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="靓丽大赛-参赛个人数据(合服保留)";

CREATE TABLE `beauty_contest_log`(
    `zone_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分区id',
    `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 '角色名称',
    `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 '参赛数据',
    PRIMARY KEY(`zone_id`, `rank`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="靓丽大赛-上期数据(合服保留)";

CREATE TABLE `beauty_contest_sign`(
    `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 '票数',
    `stage` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '最后阶段',
    `sign_award` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '报名奖励',
    `data_change` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否更新竞赛数据',
    PRIMARY KEY(`role_id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="靓丽大赛-报名数据(合服保留)";

CREATE TABLE `beauty_contest_vote_log`(
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '序号',
    `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家ID',
    `vote_name` varchar(50) NOT NULL DEFAULT '' COMMENT '投票对象',
    `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
    PRIMARY KEY(`id`)
)ENGINE=InnoDB CHARSET=utf8 COMMENT="靓丽大赛-投票记录(合服保留)";

alter table log_recharge_first add column `last_behavior` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '玩家行为';
