Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 3.22 KB

人物.md

File metadata and controls

75 lines (61 loc) · 3.22 KB

基础信息

CREATE TABLE IF NOT EXISTS `chii_persons` (
  `prsn_id` mediumint(8) unsigned NOT NULL,
  `prsn_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prsn_type` tinyint(4) unsigned NOT NULL COMMENT '个人,公司,组合',
  `prsn_infobox` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `prsn_producer` tinyint(1) NOT NULL,
  `prsn_mangaka` tinyint(1) NOT NULL,
  `prsn_artist` tinyint(1) NOT NULL,
  `prsn_seiyu` tinyint(1) NOT NULL,
  `prsn_writer` tinyint(4) NOT NULL DEFAULT '0' COMMENT '作家',
  `prsn_illustrator` tinyint(4) NOT NULL DEFAULT '0' COMMENT '绘师',
  `prsn_actor` tinyint(1) NOT NULL COMMENT '演员',
  `prsn_summary` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `prsn_img` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `prsn_img_anidb` varchar(255) CHARACTER SET utf8 NOT NULL,
  `prsn_comment` mediumint(9) unsigned NOT NULL,
  `prsn_collects` mediumint(8) unsigned NOT NULL,
  `prsn_dateline` int(10) unsigned NOT NULL,
  `prsn_lastpost` int(11) unsigned NOT NULL,
  `prsn_lock` tinyint(4) NOT NULL,
  `prsn_anidb_id` mediumint(8) unsigned NOT NULL,
  `prsn_ban` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `prsn_redirect` int(10) unsigned NOT NULL DEFAULT '0',
  `prsn_nsfw` tinyint(1) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='(现实)人物表';

prsn_img_anidb 为废弃字段,prsn_dateline没有使用。

prsn_producer,prsn_mangaka,prsn_artist,prsn_seiyu,prsn_writer,prsn_illustrator,prsn_actor 字段为编辑页面的职业勾选框。

prsn_lastpost 为最近的用户评论日期。

关联条目

人物参与的条目在chii_person_cs_index表中。

CREATE TABLE IF NOT EXISTS `chii_person_cs_index` (
  `prsn_type` enum('prsn','crt') COLLATE utf8_unicode_ci NOT NULL,
  `prsn_id` mediumint(9) unsigned NOT NULL,
  `prsn_position` smallint(5) unsigned NOT NULL COMMENT '监督,原案,脚本,..',
  `subject_id` mediumint(9) unsigned NOT NULL,
  `subject_type_id` tinyint(4) unsigned NOT NULL,
  `summary` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `prsn_appear_eps` mediumtext COLLATE utf8_unicode_ci NOT NULL COMMENT '可选,人物参与的章节'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='subjects'' credits/creator & staff (c&s)index';

此表中的prsn_type必定为"prsn"可以忽略。

需要从此表中查出 subject_type_idprsn_position,然后在预先定义的变量中查找具体职位内容。https://github.com/bangumi/server/blob/c72c7a4704565500af54d411550ce15af92fa2ed/pol/db/_const.py#L11

额外字段

chii_person_fields表为现实人物和虚拟角色的 wiki 解析字段。

CREATE TABLE IF NOT EXISTS `chii_person_fields` (
  `prsn_cat` enum('prsn','crt') COLLATE utf8_unicode_ci NOT NULL,
  `prsn_id` int(8) unsigned NOT NULL,
  `gender` tinyint(4) unsigned NOT NULL,
  `bloodtype` tinyint(4) unsigned NOT NULL,
  `birth_year` year(4) NOT NULL,
  `birth_mon` tinyint(2) unsigned NOT NULL,
  `birth_day` tinyint(2) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

表的主键为('prsn_cat', 'prsn_id')

此表中的prsn_cat可能为"prsn""crt"。查询时通过psrn_catprsn_id进行查询