mcn.sql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. -- mcn签约表
  2. drop table if exists mcn_sign;
  3. create table mcn_sign (
  4. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  5. mcn_mid int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'mcn的mid',
  6. company_name varchar(32) NOT NULL DEFAULT '' COMMENT '企业名称',
  7. company_license_id varchar(32) NOT NULL DEFAULT '' COMMENT '营业执照注册号',
  8. company_license_link varchar(255) NOT NULL DEFAULT '' COMMENT '营业执照链接',
  9. contract_link varchar(255) NOT NULL DEFAULT '' COMMENT '合同链接',
  10. contact_name varchar(16) NOT NULL DEFAULT '' COMMENT '对接人姓名',
  11. contact_title varchar(16) NOT NULL DEFAULT '' COMMENT '对接人职务',
  12. contact_idcard varchar(32) NOT NULL DEFAULT '' COMMENT '对接人身份证号',
  13. contact_phone varchar(16) NOT NULL DEFAULT '' COMMENT '对接人手机号',
  14. begin_date date NOT NULL DEFAULT '0000-00-00' COMMENT '合同开始时间',
  15. end_date date NOT NULL DEFAULT '0000-00-00' COMMENT '合同结束时间',
  16. reject_reason varchar(255) NOT NULL DEFAULT '' COMMENT '驳回理由',
  17. `reject_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '驳回时间',
  18. `pay_expire_state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '付款到期状态:1:未到期 2:即将到期',
  19. state tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态,0未申请,1待审核,2已驳回,10已签约,11冷却中,12已到期,13封禁,14清退, 15待开启,100移除',
  20. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  21. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  22. PRIMARY KEY (`id`),
  23. KEY `ix_mcn_mid` (`mcn_mid`),
  24. KEY `ix_mtime` (`mtime`),
  25. KEY `ix_state` (`state`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn签约表';
  27. -- mcn付款表
  28. drop table if exists mcn_sign_pay;
  29. CREATE TABLE mcn_sign_pay (
  30. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  31. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  32. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  33. due_date date NOT NULL DEFAULT '0000-00-00' COMMENT '付款时间',
  34. pay_value BIGINT(20) NOT NULL DEFAULT '0' COMMENT '金额',
  35. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0未支付,1已支付,100删除',
  36. note varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  37. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  38. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  39. PRIMARY KEY (id),
  40. KEY ix_signid (sign_id),
  41. KEY ix_mcn_mid (mcn_mid),
  42. KEY ix_generate_date (due_date),
  43. KEY ix_mtime (mtime)
  44. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='付款表';
  45. -- mcn up绑定表
  46. drop table if exists mcn_up;
  47. CREATE TABLE mcn_up (
  48. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  49. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  50. mcn_mid int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'mcn的mid',
  51. up_mid int(11) unsigned NOT NULL DEFAULT 0 COMMENT '绑定up的mid',
  52. begin_date date NOT NULL DEFAULT '0000-00-00' COMMENT '合同开始时间',
  53. end_date date NOT NULL DEFAULT '0000-00-00' COMMENT '合同结束时间',
  54. contract_link varchar(255) NOT NULL DEFAULT '' COMMENT '与up合同链接',
  55. up_auth_link varchar(255) NOT NULL DEFAULT '' COMMENT 'up授权协议链接',
  56. reject_reason varchar(255) NOT NULL DEFAULT '' COMMENT '驳回理由',
  57. reject_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '驳回时间',
  58. state tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0未授权,1已拒绝,2审核中,3已驳回,10已签约,11已冻结,12已到期,13封禁,14已解约,100删除',
  59. state_change_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '状态变化时间',
  60. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  61. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  62. PRIMARY KEY (id),
  63. UNIQUE KEY uk_sign_id_mcn_mid_up_mid (sign_id, mcn_mid, up_mid),
  64. KEY ix_up_mid(up_mid),
  65. KEY ix_mtime (mtime)
  66. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn绑定up表';
  67. -- 数据相关表
  68. -- 1。mcn整体数据表
  69. -- 2。mcn下各up主数据表
  70. -- 3。Top稿件表
  71. -- 1。mcn整体数据表
  72. drop table if exists mcn_data_summary;
  73. create table mcn_data_summary (
  74. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  75. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  76. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  77. up_count int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签约UP主数',
  78. fans_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计粉丝量',
  79. fans_count_online int(11) unsigned NOT NULL DEFAULT '0' COMMENT '线上涨粉量',
  80. fans_count_real int(11) unsigned NOT NULL DEFAULT '0' COMMENT '实际涨粉量',
  81. fans_count_cheat_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计作弊粉丝',
  82. fans_count_increase_day int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当日新增粉丝数',
  83. play_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计播放数',
  84. play_count_increase_day int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当日新增播放数',
  85. archive_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计投稿量',
  86. active_tid smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '分区,表示某个分区',
  87. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  88. data_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型,1按天,2按月',
  89. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  90. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  91. PRIMARY KEY (`id`),
  92. UNIQUE KEY `uk_sign_id_generate_date_active_tid_data_type` (sign_id, generate_date, active_tid, data_type),
  93. KEY ix_mcn_mid (mcn_mid),
  94. KEY `ix_mtime` (`mtime`),
  95. KEY `ix_generate_date` (`generate_date`)
  96. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn整体数据';
  97. drop table if exists mcn_data_up_detail;
  98. create table mcn_data_up_detail (
  99. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  100. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  101. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  102. up_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签约UP主ID',
  103. fans_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计粉丝量',
  104. fans_count_online int(11) unsigned NOT NULL DEFAULT '0' COMMENT '线上涨粉量',
  105. fans_count_real int(11) unsigned NOT NULL DEFAULT '0' COMMENT '实际涨粉量',
  106. fans_count_cheat_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计作弊粉丝',
  107. fans_count_increase_day int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当日新增粉丝数',
  108. play_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计播放数',
  109. play_count_increase_day int(11) unsigned NOT NULL DEFAULT '0' COMMENT '当日新增播放数',
  110. archive_count_accumulate int(11) unsigned NOT NULL DEFAULT '0' COMMENT '累计投稿量',
  111. active_tid smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT 'Up所属分区',
  112. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  113. data_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型,1按天,2按月',
  114. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  115. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  116. PRIMARY KEY (`id`),
  117. UNIQUE KEY `uk_sign_id_generate_date_data_type_up_mid` (sign_id, generate_date, data_type, up_mid),
  118. KEY ix_mcn_mid (mcn_mid),
  119. KEY `ix_mtime` (`mtime`),
  120. KEY `ix_generate_date` (`generate_date`)
  121. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn up整体数据';
  122. -- 2。mcn下各up主数据表
  123. drop table if exists mcn_data_up;
  124. create table mcn_data_up (
  125. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  126. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  127. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  128. up_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up的mid',
  129. data_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型,1累计,2昨日,3上周,4上月',
  130. fans_increase_accumulate int(11) unsigned NOT NULL default '0' COMMENT '粉丝数增涨量',
  131. archive_count int(11) unsigned NOT NULL default '0' COMMENT '投搞量',
  132. play_count int(11) unsigned NOT NULL default '0' COMMENT '播放量',
  133. fans_increase_month int(11) unsigned NOT NULL default '0' COMMENT '近一个月涨粉量',
  134. fans_count int(11) unsigned NOT NULL DEFAULT '0' COMMENT '粉丝总量',
  135. fans_count_active int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活跃粉丝总量',
  136. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  137. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  138. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  139. PRIMARY KEY (`id`),
  140. UNIQUE KEY `uk_sign_id_generate_date_data_type` (sign_id, generate_date, data_type),
  141. KEY ix_mcn_mid (mcn_mid),
  142. KEY ix_up_mid (up_mid),
  143. KEY `ix_mtime` (`mtime`),
  144. KEY `ix_generate_date` (`generate_date`)
  145. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn下up数据';
  146. -- alter table mcn_up_test add column state_change_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '状态变化时间';
  147. -- 增加字段, fat 1, uat 1, prod 1
  148. alter table mcn_data_summary add column fans_count_real_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计实际涨粉量';
  149. alter table mcn_data_summary add column fans_count_online_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计线上涨粉量';
  150. alter table mcn_data_summary add column archive_count_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增投稿量';
  151. alter table mcn_data_up_detail add column fans_count_real_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计实际涨粉量';
  152. alter table mcn_data_up_detail add column fans_count_online_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计线上涨粉量';
  153. alter table mcn_data_up_detail add column archive_count_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增投稿量';
  154. -- 修改数据字段类型,去掉unsigned, 修改播放相关的为bigint, fat 1, uat 1, prod 1
  155. alter table mcn_data_summary modify column fans_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计粉丝量';
  156. alter table mcn_data_summary modify column fans_count_online int(11) NOT NULL DEFAULT '0' COMMENT '线上涨粉量';
  157. alter table mcn_data_summary modify column fans_count_real int(11) NOT NULL DEFAULT '0' COMMENT '实际涨粉量';
  158. alter table mcn_data_summary modify column fans_count_cheat_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计作弊粉丝';
  159. alter table mcn_data_summary modify column fans_count_increase_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增粉丝数';
  160. alter table mcn_data_summary modify column play_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计播放数';
  161. alter table mcn_data_summary modify column play_count_increase_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增播放数';
  162. alter table mcn_data_summary modify column archive_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计投稿量';
  163. alter table mcn_data_up_detail modify column fans_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计粉丝量';
  164. alter table mcn_data_up_detail modify column fans_count_online int(11) NOT NULL DEFAULT '0' COMMENT '线上涨粉量';
  165. alter table mcn_data_up_detail modify column fans_count_real int(11) NOT NULL DEFAULT '0' COMMENT '实际涨粉量';
  166. alter table mcn_data_up_detail modify column fans_count_cheat_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计作弊粉丝';
  167. alter table mcn_data_up_detail modify column fans_count_increase_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增粉丝数';
  168. alter table mcn_data_up_detail modify column play_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计播放数';
  169. alter table mcn_data_up_detail modify column play_count_increase_day int(11) NOT NULL DEFAULT '0' COMMENT '当日新增播放数';
  170. alter table mcn_data_up_detail modify column archive_count_accumulate int(11) NOT NULL DEFAULT '0' COMMENT '累计投稿量';
  171. alter table mcn_data_up modify column fans_increase_accumulate int(11) NOT NULL default '0' COMMENT '粉丝数增涨量';
  172. alter table mcn_data_up modify column archive_count int(11) NOT NULL default '0' COMMENT '投搞量';
  173. alter table mcn_data_up modify column play_count bigint(20) NOT NULL default '0' COMMENT '播放量';
  174. alter table mcn_data_up modify column fans_increase_month int(11) NOT NULL default '0' COMMENT '近一个月涨粉量';
  175. alter table mcn_data_up modify column fans_count int(11) NOT NULL DEFAULT '0' COMMENT '粉丝总量';
  176. alter table mcn_data_up modify column fans_count_active int(11) NOT NULL DEFAULT '0' COMMENT '活跃粉丝总量';
  177. -- fat 1, uat 1, prod 1
  178. alter table mcn_data_summary modify column play_count_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计播放数';
  179. alter table mcn_data_summary modify column play_count_increase_day bigint(20) NOT NULL DEFAULT '0' COMMENT '当日/月新增播放数';
  180. alter table mcn_data_up_detail modify column play_count_accumulate bigint(20) NOT NULL DEFAULT '0' COMMENT '累计播放数';
  181. alter table mcn_data_up_detail modify column play_count_increase_day bigint(20) NOT NULL DEFAULT '0' COMMENT '当日/月新增播放数';
  182. alter table mcn_sign modify column reject_time datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '驳回时间';
  183. -- fat 1, uat 1, prod 1, 增加时间上的索引
  184. create index ix_end_date on mcn_sign (end_date);
  185. create index ix_begin_date on mcn_sign (begin_date);
  186. create index ix_end_date on mcn_up (end_date);
  187. create index ix_begin_date on mcn_up (begin_date);
  188. --------- 2期
  189. -- fat 1, uat 1, prod 1, 增加表
  190. alter table mcn_up add column up_type tinyint(4) not null default '0' comment '用户类型,0为站内,1为站外';
  191. alter table mcn_up add column site_link varchar(255) not null default '' comment 'up主站外账号链接';
  192. -- mcn_data_import_up: table
  193. CREATE TABLE `mcn_data_import_up` (
  194. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  195. `mcn_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  196. `sign_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  197. `up_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'UP主 mid',
  198. `standard_fans_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '达标粉丝数类型, 1: 1w粉丝',
  199. `standard_fans_date` int(11) NOT NULL DEFAULT '0' COMMENT '达到粉丝数门槛花费的时间,秒',
  200. `standard_archive_count` int(11) NOT NULL DEFAULT '0' COMMENT '达标时投稿量',
  201. `standard_fans_count` int(11) NOT NULL DEFAULT '0' COMMENT '达标时粉丝数',
  202. `is_reward` int(11) NOT NULL DEFAULT '0' COMMENT '奖励情况 0:未奖励 1:已奖励',
  203. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  204. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  205. PRIMARY KEY (`id`),
  206. UNIQUE KEY `uk_sign_id_mid_type` (`sign_id`,`up_mid`,`standard_fans_type`),
  207. KEY `ix_mtime` (`mtime`)
  208. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='引入账号数据表';
  209. -- mcn_up_recommend_pool: table
  210. CREATE TABLE `mcn_up_recommend_pool` (
  211. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  212. `up_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up mid',
  213. `fans_count` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '粉丝量',
  214. `fans_count_increase_month` int(11) NOT NULL DEFAULT '0' COMMENT '本月粉丝增长量',
  215. `archive_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总稿件数',
  216. `play_count_accumulate` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '累积播放量',
  217. `play_count_average` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '稿均播放量',
  218. `active_tid` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '分区,表示某个分区',
  219. `last_archive_time` datetime NOT NULL DEFAULT '1970-01-01 08:00:00' COMMENT '最近投稿时间',
  220. `state` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '推荐池状态: 1:未推荐 2:推荐 3:禁止推荐 100:移除',
  221. `source` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '推荐池来源: 1:自动添加(大数据) 2:手动添加',
  222. `generate_time` datetime NOT NULL DEFAULT '1970-01-01 08:00:00' COMMENT '大数据更新时间',
  223. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  224. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  225. PRIMARY KEY (`id`),
  226. UNIQUE KEY `uk_up_mid` (`up_mid`),
  227. KEY `ix_state` (`state`),
  228. KEY `ix_active_tid` (`active_tid`),
  229. KEY `ix_fans_count` (`fans_count`),
  230. KEY `ix_play_count_accumulate` (`play_count_accumulate`),
  231. KEY `ix_play_count_average` (`play_count_average`),
  232. KEY `ix_fans_count_increase_month` (`fans_count_increase_month`),
  233. KEY `ix_source` (`source`),
  234. KEY `ix_generate_time` (`generate_time`),
  235. KEY `ix_mtime` (`mtime`)
  236. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn-up主推荐池';
  237. -- mcn_up_recommend_source: table
  238. CREATE TABLE `mcn_up_recommend_source` (
  239. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  240. `up_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up mid',
  241. `fans_count` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '粉丝量',
  242. `fans_count_increase_month` int(11) NOT NULL DEFAULT '0' COMMENT '本月粉丝增长量',
  243. `archive_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '总稿件数',
  244. `play_count_accumulate` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '累积播放量',
  245. `play_count_average` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '稿均播放量',
  246. `active_tid` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '分区,表示某个分区',
  247. `last_archive_time` datetime NOT NULL DEFAULT '1970-01-01 08:00:00' COMMENT '最近投稿时间',
  248. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  249. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  250. PRIMARY KEY (`id`),
  251. KEY `ix_up_mid` (`up_mid`),
  252. KEY `ix_mtime` (`mtime`)
  253. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn-up主推荐池的来源(大数据提供)';
  254. -- fat 1, uat 1, prod 0
  255. -- 1。涨粉量排名
  256. create table mcn_rank_up_fans (
  257. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  258. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  259. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  260. up_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up的mid',
  261. value1 int(11) NOT NULL default '0' COMMENT '数据1',
  262. value2 int(11) NOT NULL default '0' COMMENT '数据2',
  263. active_tid smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '分区,表示某个分区',
  264. data_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型,1累计(总榜),2昨日,3上周,4上月,5活跃粉丝(累计)',
  265. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  266. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  267. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  268. PRIMARY KEY (`id`),
  269. UNIQUE KEY `uk_sign_id_generate_date_data_type_up_mid` (sign_id, generate_date, data_type, up_mid),
  270. KEY ix_mcn_mid (mcn_mid),
  271. KEY ix_up_mid (up_mid),
  272. KEY `ix_mtime` (`mtime`),
  273. KEY `ix_generate_date` (`generate_date`)
  274. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn下up涨粉量排名';
  275. -- 2。Top稿件表
  276. create table mcn_rank_archive_likes (
  277. id int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  278. mcn_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  279. sign_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  280. up_mid int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up的mid',
  281. archive_id bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '稿件id',
  282. like_count bigint(20) NOT NULL DEFAULT '0' COMMENT '日/周/月新增点赞数,根据data_type统计',
  283. data_type tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据类型,1累计,2昨日,3上周,4上月',
  284. tid smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '分区ID',
  285. generate_date date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  286. ctime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  287. mtime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  288. PRIMARY KEY (`id`),
  289. KEY ix_mcn_mid (mcn_mid),
  290. KEY `ix_mtime` (`mtime`),
  291. KEY `ix_generate_date` (`generate_date`),
  292. UNIQUE KEY `uk_sign_id_generate_date_data_type_archive_id` (sign_id, generate_date, data_type, archive_id)
  293. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='mcn下top稿件表';
  294. -- mcn_data_up_cheat: table
  295. CREATE TABLE `mcn_data_up_cheat` (
  296. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  297. `mcn_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn mid',
  298. `sign_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'mcn签约ID',
  299. `up_mid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'up主 mid',
  300. `generate_date` date NOT NULL DEFAULT '0000-00-00' COMMENT '计算日',
  301. `fans_count_cheat_increase_day` int(11) NOT NULL DEFAULT '0' COMMENT '新增作弊粉丝量',
  302. `fans_count_cheat_cleaned_accumulate` int(11) NOT NULL DEFAULT '0' COMMENT '已清除粉丝量',
  303. `ctime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  304. `mtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  305. PRIMARY KEY (`id`),
  306. UNIQUE KEY `uk_up_mid_sign_id_generate_date` (`up_mid`,`sign_id`,`generate_date`),
  307. KEY `ix_mcn_mid` (`mcn_mid`),
  308. KEY `ix_mtime` (`mtime`),
  309. KEY `ix_generate_date` (`generate_date`)
  310. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='作弊筛选详情表'
  311. ;
  312. -- fat 1, uat 1, prod 0
  313. ALTER TABLE mcn_rank_archive_likes CHANGE archive_id avid bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '稿件id';
  314. ALTER TABLE `bilibili_upcrm`.`mcn_data_up_cheat`
  315. ADD COLUMN `fans_count_cheat_accumulate` int(11) NOT NULL DEFAULT '0' COMMENT '累计作弊粉丝',
  316. ADD COLUMN `fans_count_accumulate` int(11) NOT NULL DEFAULT '0' COMMENT '实际粉丝量';
  317. -- fat 1, uat 1, prod 0
  318. ALTER TABLE mcn_up ADD COLUMN confirm_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'up确认时间';
  319. --------四期-------
  320. alter table mcn_sign add permission int(11) unsigned default '1' not null comment '权限列表-属性位';
  321. alter table mcn_up
  322. add permission int(11) unsigned default '1' not null comment '权限列表-属性位',
  323. add publication_price bigint default '0' not null comment '刊例价(千分位*1000)';