-- tyl 
-- 境界学位

CREATE TABLE IF NOT EXISTS `player_degree` (
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家Id',
  `degree_id` smallint(5) unsigned NOT NULL COMMENT '学位Id(对应学位等级)',
  `degree_exp` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '学位经验',
  `dun_state` varchar(255) NOT NULL DEFAULT '[]' COMMENT '副本完成状态，0未完成 1完成',
  `time` int(11) unsigned NOT NULL COMMENT '刷新时间戳',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='境界学位表';

CREATE TABLE IF NOT EXISTS `player_degree_classwork` (
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '玩家Id',
  `class_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '日常功课Id',
  `content` varchar(255) NOT NULL DEFAULT '[]' COMMENT '日常功课状态数据',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '刷新时间戳',
  PRIMARY KEY (`role_id`,`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学位日常功课任务表';

-- 日志表
CREATE TABLE IF NOT EXISTS `log_degree_upgrade` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `degree_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '学位Id',
  `exp` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '学位经验',
  `dun_state` varchar(255) NOT NULL DEFAULT '[]' COMMENT '副本状态',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间戳',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='学位晋升日志表';

CREATE TABLE IF NOT EXISTS `log_receive_degree_reward` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `role_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '角色Id',
  `class_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '功课Id',
  `task_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '任务类型',
  `task_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '任务Id',
  `old_exp` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '晋升前学位经验',
  `new_exp` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '晋升后学位经验',
  `time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '时间戳',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='学位日常功课奖励领取日志表';
