db.sql 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. CREATE TABLE `admin_user` (
  2. `admin_user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员编号',
  3. `username` varchar(32) NOT NULL COMMENT '登录昵称',
  4. `head_img` varchar(256) DEFAULT NULL COMMENT '用户头像',
  5. `passwd` varchar(64) NOT NULL COMMENT '登录密码',
  6. `phone` varchar(11) DEFAULT NULL COMMENT '手机号码',
  7. `email` varchar(32) DEFAULT NULL COMMENT '邮件地址',
  8. `memo` varchar(512) DEFAULT NULL COMMENT '备注信息',
  9. `state` tinyint(4) NOT NULL DEFAULT 1 COMMENT '有效状态,见ValidStateEnum',
  10. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  11. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  12. PRIMARY KEY (`admin_user_id`)
  13. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='管理员信息表';
  14. CREATE TABLE `admin_user_role` (
  15. `admin_user_role_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员角色编号',
  16. `admin_user_id` bigint(20) unsigned NOT NULL COMMENT '管理员编号',
  17. `admin_role_id` bigint(20) unsigned NOT NULL COMMENT '角色编号',
  18. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  19. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  20. PRIMARY KEY (`admin_user_role_id`)
  21. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='管理员角色信息表';
  22. CREATE TABLE `admin_role` (
  23. `admin_role_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员角色编号',
  24. `name` varchar(32) NOT NULL COMMENT '角色名称',
  25. `memo` varchar(512) DEFAULT NULL COMMENT '备注信息',
  26. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  27. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  28. PRIMARY KEY (`admin_role_id`)
  29. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='角色信息表';
  30. CREATE TABLE `admin_role_permission` (
  31. `admin_role_permission_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色权限编号',
  32. `admin_role_id` bigint(20) unsigned NOT NULL COMMENT '角色编号',
  33. `admin_permission_id` bigint(20) unsigned NOT NULL COMMENT '权限编号',
  34. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  35. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  36. PRIMARY KEY (`admin_role_permission_id`)
  37. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='角色权限信息表';
  38. CREATE TABLE `admin_permission` (
  39. `admin_permission_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '权限编号',
  40. `parent_admin_permission_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '父权限编号',
  41. `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '权限类型,见PermissionTypeEnum',
  42. `code` varchar(64) NOT NULL COMMENT '权限编码',
  43. `name` varchar(32) NOT NULL COMMENT '权限名称',
  44. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  45. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  46. PRIMARY KEY (`admin_permission_id`)
  47. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='权限信息表';
  48. CREATE TABLE `admin_user_login` (
  49. `admin_login_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '登录编号',
  50. `admin_user_id` bigint(20) unsigned NOT NULL COMMENT '管理员编号',
  51. `user_agent` varchar(512) DEFAULT NULL COMMENT '客户端',
  52. `area` varchar(64) DEFAULT NULL COMMENT '城市',
  53. `ip` int(11) DEFAULT 0 COMMENT 'IP地址',
  54. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  55. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  56. PRIMARY KEY (`admin_login_id`)
  57. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='管理员登录信息表';
  58. CREATE TABLE `user` (
  59. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  60. `phone` varchar(11) DEFAULT NULL COMMENT '用户手机号',
  61. `nick_name` varchar(32) NOT NULL COMMENT '用户昵称',
  62. `head_img` varchar(256) DEFAULT NULL COMMENT '用户头像',
  63. `gender` tinyint(4) NOT NULL COMMENT '用户性别',
  64. `birth_date` varchar(10) DEFAULT NULL COMMENT '用户生日',
  65. `city_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户居住城市',
  66. `native_city_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户家乡城市',
  67. `height` double UNSIGNED NOT NULL DEFAULT 0 COMMENT '身高',
  68. `weight` double UNSIGNED NOT NULL DEFAULT 0 COMMENT '体重',
  69. `education` tinyint(4) NOT NULL DEFAULT 0 COMMENT '学历',
  70. `occupation` varchar(32) DEFAULT NULL COMMENT '职业',
  71. `introduce` varchar(512) DEFAULT NULL COMMENT '自我介绍',
  72. `family` varchar(512) DEFAULT NULL COMMENT '家庭情况',
  73. `half` varchar(512) DEFAULT NULL COMMENT '选偶条件',
  74. `realname_state` tinyint(4) NOT NULL DEFAULT 1 COMMENT '实人认证状态,见RealnameStateEnum',
  75. `im_token` varchar(128) DEFAULT NULL comment '第三方IM长连接token',
  76. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  77. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  78. PRIMARY KEY (`user_id`)
  79. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';
  80. CREATE TABLE `user_image` (
  81. `image_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '个人形象编号',
  82. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  83. `image_url` varchar(256) NOT NULL COMMENT '图片地址',
  84. `audit_state` tinyint(4) unsigned NOT NULL COMMENT '审核状态',
  85. `audit_desc` VARCHAR(64) DEFAULT NULL COMMENT '审核描述',
  86. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  87. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  88. PRIMARY KEY (`image_id`),
  89. KEY (`user_id`)
  90. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人形象表';
  91. CREATE TABLE `user_interest` (
  92. `interest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '个性兴趣编号',
  93. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  94. `interest_tag_id` bigint(20) unsigned NOT NULL COMMENT '个性标签',
  95. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  96. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  97. PRIMARY KEY (`interest_id`),
  98. KEY (`user_id`)
  99. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个性标签表';
  100. CREATE TABLE `user_friend` (
  101. `friend_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '好友编号',
  102. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  103. `friend_user_id` bigint(20) unsigned NOT NULL COMMENT '好友用户编号',
  104. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  105. PRIMARY KEY (`friend_id`),
  106. UNIQUE KEY (`user_id`, `friend_user_id`)
  107. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户好友表';
  108. CREATE TABLE `user_follow` (
  109. `follow_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '关注编号',
  110. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  111. `follow_user_id` bigint(20) unsigned NOT NULL COMMENT '关注用户编号',
  112. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  113. PRIMARY KEY (`follow_id`),
  114. UNIQUE KEY (`user_id`, `follow_user_id`)
  115. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户关注表';
  116. CREATE TABLE `user_visit` (
  117. `visit_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '访问编号',
  118. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  119. `visit_user_id` bigint(20) unsigned NOT NULL COMMENT '访问用户编号',
  120. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  121. PRIMARY KEY (`visit_id`),
  122. KEY (`visit_user_id`)
  123. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户访问表';
  124. CREATE TABLE `user_realname` (
  125. `realname_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '实人认证编号',
  126. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  127. `real_name` varchar(16) NOT NULL COMMENT '真实姓名',
  128. `id_card` varchar(18) NOT NULL COMMENT '身份证号',
  129. `img_url` varchar(256) NOT NULL COMMENT '图片地址',
  130. `result` tinyint(4) DEFAULT NULL COMMENT '认证结果,见RealnameResultEnum',
  131. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  132. PRIMARY KEY (`realname_id`),
  133. KEY (`user_id`)
  134. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户实人认证表';
  135. CREATE TABLE `purse_account` (
  136. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  137. `bean` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '红豆数量',
  138. `sugar` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '糖数量',
  139. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  140. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  141. PRIMARY KEY (`user_id`)
  142. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='钱包账户表';
  143. CREATE TABLE `purse_recharge` (
  144. `recharge_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '充值编号',
  145. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  146. `product_id` bigint(20) unsigned NOT NULL COMMENT '充值产品编号',
  147. `fee` bigint(20) unsigned NOT NULL COMMENT '充值金额',
  148. `bean` bigint(20) unsigned NOT NULL COMMENT '红豆数量',
  149. `first_bean` bigint(20) unsigned NOT NULL COMMENT '首充赠送红豆数量',
  150. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  151. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  152. PRIMARY KEY (`recharge_id`)
  153. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包充值表';
  154. CREATE TABLE `purse_recharge_product` (
  155. `product_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '充值产品编号',
  156. `apple_product_id` varchar(128) DEFAULT NULL COMMENT '充值苹果产品',
  157. `fee` bigint(20) unsigned NOT NULL COMMENT '产品金额',
  158. `bean` bigint(20) unsigned NOT NULL COMMENT '产品红豆数量',
  159. `first_bean` bigint(20) unsigned NOT NULL COMMENT '产品首充赠送红豆数量',
  160. `sort_flag` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '排序标识(降序)',
  161. `group` tinyint(4) unsigned NOT NULL COMMENT '产品分组',
  162. `state` tinyint(4) unsigned NOT NULL COMMENT '产品状态',
  163. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  164. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  165. PRIMARY KEY (`product_id`)
  166. ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包充值产品表';
  167. CREATE TABLE `purse_withdraw` (
  168. `withdraw_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '提现编号',
  169. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  170. `fee` bigint(20) unsigned NOT NULL COMMENT '提现金额',
  171. `sugar` bigint(20) unsigned NOT NULL COMMENT '消耗糖数量',
  172. `identity_id` bigint(20) unsigned NOT NULL COMMENT '提现账户编号',
  173. `state` tinyint(4) unsigned NOT NULL COMMENT '提现状态',
  174. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  175. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  176. PRIMARY KEY (`withdraw_id`)
  177. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包提现表';
  178. CREATE TABLE `purse_withdraw_identity` (
  179. `identity_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '提现身份编号',
  180. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  181. `type` tinyint(4) unsigned NOT NULL COMMENT '提现身份类型',
  182. `identity` VARCHAR(1024) NOT NULL COMMENT '提现身份',
  183. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  184. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  185. PRIMARY KEY (`identity_id`)
  186. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包提现身份表';
  187. CREATE TABLE `transaction` (
  188. `transaction_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '交易编号',
  189. `type` tinyint(4) unsigned NOT NULL COMMENT '交易类型',
  190. `out_id` bigint(20) unsigned NOT NULL COMMENT '外部业务编号',
  191. `original_transaction_id` bigint(20) unsigned DEFAULT 0 COMMENT '原来交易编号',
  192. `kind` tinyint(4) unsigned NOT NULL COMMENT '交易分类',
  193. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  194. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  195. PRIMARY KEY (`transaction_id`)
  196. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包交易表';
  197. CREATE TABLE `transaction_item` (
  198. `transaction_item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '交易项编号',
  199. `transaction_id` bigint(20) unsigned NOT NULL COMMENT '交易编号',
  200. `sub_type` tinyint(4) unsigned NOT NULL COMMENT '交易子分类',
  201. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  202. `bean` bigint(20) NOT NULL COMMENT '红豆数量变化',
  203. `sugar` bigint(20) NOT NULL COMMENT '糖数量变化',
  204. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  205. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  206. PRIMARY KEY (`transaction_item_id`)
  207. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='钱包交易项表';
  208. CREATE TABLE `question` (
  209. `question_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '问题编号',
  210. `question_user_id` bigint(20) unsigned NOT NULL COMMENT '提问用户编号',
  211. `question` VARCHAR(256) NOT NULL COMMENT '提问内容',
  212. `question_time` DATETIME NOT NULL COMMENT '提问时间',
  213. `question_bean` bigint(20) unsigned NOT NULL COMMENT '提问消耗红豆数量',
  214. `watch_bean` bigint(20) unsigned NOT NULL COMMENT '围观消耗红豆数量',
  215. `question_audit_state` tinyint(4) unsigned NOT NULL COMMENT '提问审核状态',
  216. `question_audit_desc` VARCHAR(64) DEFAULT NULL COMMENT '提问审核描述',
  217. `answer_user_id` bigint(20) unsigned NOT NULL COMMENT '回答用户编号',
  218. `answer` VARCHAR(256) DEFAULT NULL COMMENT '回答内容',
  219. `answer_time` DATETIME DEFAULT NULL COMMENT '回答时间',
  220. `answer_audit_state` tinyint(4) unsigned NOT NULL COMMENT '回答审核状态',
  221. `answer_audit_desc` VARCHAR(64) DEFAULT NULL COMMENT '回答审核描述',
  222. `state` tinyint(4) unsigned NOT NULL COMMENT '问题状态',
  223. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  224. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  225. PRIMARY KEY (`question_id`)
  226. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='问题表';
  227. CREATE TABLE `question_watch` (
  228. `question_watch_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '问题围观编号',
  229. `watch_user_id` bigint(20) unsigned NOT NULL COMMENT '围观用户编号',
  230. `question_id` bigint(20) unsigned NOT NULL COMMENT '问题编号',
  231. `watch_bean` bigint(20) unsigned NOT NULL COMMENT '围观消耗红豆数量',
  232. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  233. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  234. PRIMARY KEY (`question_watch_id`)
  235. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='问题围观表';
  236. CREATE TABLE `trade_order` (
  237. `order_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单编号',
  238. `order_no` VARCHAR(32) NOT NULL COMMENT '订单号',
  239. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  240. `device_no` varchar(64) NOT NULL COMMENT '设备唯一码',
  241. `type` tinyint(4) unsigned NOT NULL COMMENT '订单类型',
  242. `out_id` bigint(20) unsigned NOT NULL COMMENT '外部业务编号',
  243. `total_fee` bigint(20) unsigned NOT NULL COMMENT '订单金额',
  244. `pay_type` tinyint(4) DEFAULT NULL COMMENT '支付类型',
  245. `pay_fee` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '支付金额',
  246. `pay_no` VARCHAR(64) DEFAULT NULL COMMENT '支付号',
  247. `pay_time` DATETIME DEFAULT NULL COMMENT '支付时间',
  248. `state` tinyint(4) unsigned NOT NULL COMMENT '订单状态',
  249. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  250. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  251. PRIMARY KEY (`order_id`)
  252. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
  253. CREATE TABLE `moment` (
  254. `moment_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '动态编号',
  255. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  256. `type` tinyint(4) unsigned NOT NULL COMMENT '动态类型,MomentTypeEnum',
  257. `title` varchar(1024) DEFAULT NULL COMMENT '动态描述',
  258. `content` varchar(2048) DEFAULT NULL COMMENT '动态内容',
  259. `visible` tinyint(4) unsigned NOT NULL DEFAULT 1 COMMENT '动态类型,MomentVisibleEnum',
  260. `tag` tinyint(4) unsigned NOT NULL COMMENT '动态标签,MomentTagEnum',
  261. `topic` varchar(128) DEFAULT NULL COMMENT '动态话题(多个用逗号分隔)',
  262. `audit_state` tinyint(4) unsigned NOT NULL COMMENT '审核状态,AuditStateEnum',
  263. `audit_memo` varchar(128) DEFAULT NULL COMMENT '审核备注',
  264. `audit_admin_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '审核管理员编号',
  265. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  266. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  267. PRIMARY KEY (`moment_id`),
  268. KEY(`user_id`)
  269. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人动态表';
  270. CREATE TABLE `moment_comment` (
  271. `comment_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '点赞编号',
  272. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  273. `at_comment_id` bigint(20) unsigned NOT NULL COMMENT '回复评论编号',
  274. `at_user_id` bigint(20) unsigned NOT NULL COMMENT '回复用户编号',
  275. `moment_id` bigint(20) unsigned NOT NULL COMMENT '动态编号',
  276. `comment` varchar(512) NOT NULL COMMENT '评论内容',
  277. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  278. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  279. PRIMARY KEY (`comment_id`),
  280. KEY(`moment_id`)
  281. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人动态评论表';
  282. CREATE TABLE `moment_like` (
  283. `like_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '点赞编号',
  284. `like_user_id` bigint(20) unsigned NOT NULL COMMENT '点赞用户编号',
  285. `moment_id` bigint(20) unsigned NOT NULL COMMENT '动态编号',
  286. `comment_id` bigint(20) unsigned NOT NULL COMMENT '评论编号',
  287. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  288. PRIMARY KEY (`like_id`),
  289. KEY(`like_user_id`)
  290. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人动态点赞表';
  291. CREATE TABLE `moment_share` (
  292. `share_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '分享编号',
  293. `device_no` varchar(64) NOT NULL COMMENT '客户端生成唯一码',
  294. `share_user_id` bigint(20) unsigned NOT NULL COMMENT '分享用户编号',
  295. `moment_id` bigint(20) unsigned NOT NULL COMMENT '动态编号',
  296. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  297. PRIMARY KEY (`share_id`)
  298. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人动态分享表';
  299. CREATE TABLE `moment_user_pay` (
  300. `pay_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '付费编号',
  301. `pay_user_id` bigint(20) unsigned NOT NULL COMMENT '付费用户编号',
  302. `moment_user_id` bigint(20) unsigned NOT NULL COMMENT '动态用户编号',
  303. `pay_bean` bigint(20) unsigned NOT NULL COMMENT '查看动态消耗红豆数量',
  304. `begin_time` DATETIME NOT NULL COMMENT '生效开始时间',
  305. `end_time` DATETIME NOT NULL COMMENT '生效截止时间',
  306. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  307. PRIMARY KEY (`pay_id`)
  308. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='用户个人动态付费表';
  309. CREATE TABLE `cp_match` (
  310. `match_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'CP配对编号',
  311. `type` tinyint(4) unsigned NOT NULL DEFAULT 1 COMMENT '配对类型,CpMatchTypeEnum',
  312. `user_id` bigint(20) unsigned NOT NULL COMMENT '发起配对用户编号',
  313. `match_user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '选择配对用户编号',
  314. `begin_time` DATETIME NOT NULL COMMENT '开始时间',
  315. `state` tinyint(4) unsigned NOT NULL COMMENT '配对状态,CpStateEnum',
  316. `room_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '分配配对房间编号',
  317. `result` tinyint(4) unsigned NOT NULL COMMENT '配对结果,CpResultEnum',
  318. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  319. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  320. PRIMARY KEY (`match_id`)
  321. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='CP配对表';
  322. CREATE TABLE `cp_match_candidate` (
  323. `match_candidate_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'CP配对报名编号',
  324. `match_id` bigint(20) unsigned NOT NULL COMMENT 'CP配对编号',
  325. `user_id` bigint(20) unsigned NOT NULL COMMENT '报名用户编号',
  326. `gift_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '赠送礼物编号',
  327. `bean` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '赠送消耗红豆数量',
  328. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  329. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  330. PRIMARY KEY (`match_candidate_id`),
  331. UNIQUE KEY `uk_match_user`(`match_id`, `user_id`)
  332. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='CP配对报名表';
  333. CREATE TABLE `gift` (
  334. `gift_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '礼物编号',
  335. `name` varchar(16) NOT NULL COMMENT '礼物名称',
  336. `img` varchar(256) NOT NULL COMMENT '礼物图片',
  337. `cartoon` varchar(256) DEFAULT NULL COMMENT '礼物动画',
  338. `bean` bigint(20) unsigned NOT NULL COMMENT '礼物对等红豆数量',
  339. `sort_flag` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '排序标识(降序)',
  340. `type` tinyint(4) unsigned NOT NULL COMMENT '礼物类型,见GiftTypeEnum',
  341. `state` tinyint(4) unsigned NOT NULL COMMENT '礼物状态,见GiftStateEnum',
  342. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  343. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  344. PRIMARY KEY (`gift_id`)
  345. ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COMMENT='礼物表';
  346. CREATE TABLE `gift_send` (
  347. `gift_send_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '礼物赠送编号',
  348. `send_user_id` bigint(20) unsigned NOT NULL COMMENT '送礼物用户编号',
  349. `receive_user_id` bigint(20) unsigned NOT NULL COMMENT '收礼物用户编号',
  350. `gift_id` bigint(20) unsigned NOT NULL COMMENT '礼物编号',
  351. `out_type` tinyint(4) unsigned NOT NULL COMMENT '关联送礼物业务类型, 见GiftOutTypeEnum',
  352. `out_id` bigint(20) unsigned NOT NULL COMMENT '关联送礼物业务编号',
  353. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  354. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  355. PRIMARY KEY (`gift_send_id`)
  356. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='礼物赠送表';
  357. CREATE TABLE `message` (
  358. `message_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '消息通知编号',
  359. `type` tinyint(4) unsigned NOT NULL COMMENT '消息类型, 见MessageTypeEnum',
  360. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  361. `content` varchar(256) NOT NULL COMMENT '消息内容',
  362. `jump_path` varchar(1024) DEFAULT NULL COMMENT '跳转路径',
  363. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  364. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  365. PRIMARY KEY (`message_id`)
  366. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='消息通知表';
  367. CREATE TABLE `template_room` (
  368. `template_room_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间模板编号',
  369. `template_name` varchar(64) NOT NULL comment '模板房间名称',
  370. `type` tinyint(4) unsigned NOT NULL COMMENT '房间类型, 见RoomTypeEnum',
  371. `notice` varchar(256) DEFAULT NULL COMMENT '房间公告',
  372. `start_tip` varchar(256) DEFAULT NULL COMMENT '开始提示',
  373. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  374. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  375. `deadline_sec` bigint(20) unsigned NOT NULL COMMENT '房间截止秒数',
  376. `app_version` bigint(11) unsigned NOT NULL DEFAULT 0 COMMENT '房间支持最低版本',
  377. `valid` tinyint(4) unsigned NOT NULL COMMENT '房间模板是否有效',
  378. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  379. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  380. PRIMARY KEY (`template_room_id`)
  381. ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COMMENT='房间模板表';
  382. CREATE TABLE `template_phase` (
  383. `template_phase_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '环节模板编号',
  384. `name` varchar(64) NOT NULL COMMENT '环节名称',
  385. `rule` varchar(256) DEFAULT NULL COMMENT '环节规则',
  386. `type` tinyint(4) unsigned NOT NULL COMMENT '环节类型,见PhaseTypeEnum',
  387. `app_version` bigint(11) unsigned NOT NULL DEFAULT 0 COMMENT '房间支持最低版本',
  388. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  389. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  390. PRIMARY KEY (`template_phase_id`)
  391. ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COMMENT='环节模板表';
  392. CREATE TABLE `template_room_phase` (
  393. `template_room_phase_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间环节模板编号',
  394. `template_room_id` bigint(20) unsigned NOT NULL COMMENT '房间模板编号',
  395. `template_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节模板编号',
  396. `template_phase_data` varchar(2048) DEFAULT NULL COMMENT '环节模板数据',
  397. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  398. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  399. KEY (`template_room_id`),
  400. PRIMARY KEY (`template_room_phase_id`)
  401. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='房间环节模板表';
  402. CREATE TABLE `template_question` (
  403. `template_question_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间问题题库编号',
  404. `question` varchar(256) NOT NULL COMMENT '问题内容',
  405. `option_a` varchar(32) NOT NULL COMMENT '选项A',
  406. `option_b` varchar(32) NOT NULL COMMENT '选项B',
  407. `valid_state` tinyint(4) unsigned NOT NULL COMMENT '有效状态, 见ValidStateEnum',
  408. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  409. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  410. PRIMARY KEY (`template_question_id`)
  411. ) ENGINE=InnoDB AUTO_INCREMENT=100001 DEFAULT CHARSET=utf8mb4 COMMENT='房间问题题库表';
  412. CREATE TABLE `room` (
  413. `room_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间编号',
  414. `name` varchar(64) NOT NULL COMMENT '房间名称',
  415. `notice` varchar(256) DEFAULT NULL COMMENT '房间公告',
  416. `start_tip` varchar(256) DEFAULT NULL COMMENT '开始提示',
  417. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  418. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  419. `type` tinyint(4) unsigned NOT NULL COMMENT '房间类型, 见RoomTypeEnum',
  420. `state` tinyint(4) unsigned NOT NULL COMMENT '房间状态, 见RoomStateEnum',
  421. `deadline_sec` bigint(20) unsigned NOT NULL COMMENT '房间截止秒数',
  422. `app_version` bigint(11) unsigned NOT NULL DEFAULT 0 COMMENT '房间支持最低版本',
  423. `template_room_id` bigint(20) unsigned NOT NULL COMMENT '房间模板编号',
  424. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  425. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  426. PRIMARY KEY (`room_id`)
  427. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间表';
  428. CREATE TABLE `room_mic` (
  429. `room_mic_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间麦位编号',
  430. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  431. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  432. `type` tinyint(4) unsigned NOT NULL COMMENT '麦展示类型, 见MicTypeEnum',
  433. `state` tinyint(4) unsigned NOT NULL COMMENT '麦状态, 见MicStateEnum',
  434. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  435. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  436. PRIMARY KEY (`room_mic_id`)
  437. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间麦位表';
  438. CREATE TABLE `room_user` (
  439. `room_user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间用户编号',
  440. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  441. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  442. `last_enter_time` DATETIME NOT NULL COMMENT '最后一次进入时间',
  443. `last_exit_time` DATETIME DEFAULT NULL COMMENT '最后一次离开时间',
  444. `enter_count` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '进入次数',
  445. `duration_sec` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '进入时长',
  446. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  447. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  448. PRIMARY KEY (`room_user_id`)
  449. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间用户表';
  450. CREATE TABLE `room_phase` (
  451. `room_phase_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间环节编号',
  452. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  453. `name` varchar(64) NOT NULL COMMENT '环节名称',
  454. `rule` varchar(256) DEFAULT NULL COMMENT '环节规则',
  455. `type` tinyint(4) unsigned NOT NULL COMMENT '环节类型, 见PhaseTypeEnum',
  456. `state` tinyint(4) unsigned NOT NULL COMMENT '环节状态, 见PhaseStateEnum',
  457. `valid_state` tinyint(4) unsigned NOT NULL DEFAULT 1 COMMENT '在用状态,ValidStateEnum',
  458. `template_room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间模环节板编号',
  459. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  460. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  461. KEY (`room_id`),
  462. PRIMARY KEY (`room_phase_id`)
  463. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间环节表';
  464. CREATE TABLE `room_match` (
  465. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  466. `match_id` bigint(20) unsigned NOT NULL COMMENT 'CP配对编号',
  467. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  468. `match_user_id` bigint(20) unsigned NOT NULL COMMENT '配对用户编号',
  469. `begin_time` DATETIME NOT NULL COMMENT '开始时间',
  470. `result` tinyint(4) unsigned NOT NULL COMMENT 'CP配对结果, 见CpResultEnum',
  471. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  472. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  473. PRIMARY KEY (`room_id`)
  474. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='CP配对房间表';
  475. -- 自我介绍
  476. CREATE TABLE `room_phase_introduce` (
  477. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间自我介绍环节编号',
  478. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  479. `start_audio_sec` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '开始音频时长(秒)',
  480. `left_audio_path` varchar(256) DEFAULT NULL COMMENT '左侧音频文件',
  481. `left_audio_sec` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '左侧音频时长(秒)',
  482. `left_tip` varchar(256) DEFAULT NULL COMMENT '左侧开始提示',
  483. `right_audio_path` varchar(256) DEFAULT NULL COMMENT '右侧音频文件',
  484. `right_audio_sec` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '右侧音频时长(秒)',
  485. `right_tip` varchar(256) DEFAULT NULL COMMENT '右侧开始提示',
  486. `countdown_sec` bigint(20) unsigned NOT NULL COMMENT '每个人倒计时',
  487. `user_id` bigint(20) unsigned NOT NULL COMMENT '发起用户编号',
  488. `user_state` tinyint(4) unsigned NOT NULL COMMENT '发起用户自我介绍状态, 见IntroduceStateEnum',
  489. `user_begin_time` DATETIME DEFAULT NULL COMMENT '发起用户开始时间',
  490. `user_end_time` DATETIME DEFAULT NULL COMMENT '发起用户截止时间',
  491. `match_user_id` bigint(20) unsigned NOT NULL COMMENT '配对用户编号',
  492. `match_user_state` tinyint(4) unsigned NOT NULL COMMENT '配对用户自我介绍状态, 见IntroduceStateEnum',
  493. `match_user_begin_time` DATETIME DEFAULT NULL COMMENT '配对用户开始时间',
  494. `match_user_end_time` DATETIME DEFAULT NULL COMMENT '配对用户截止时间',
  495. PRIMARY KEY (`room_phase_id`)
  496. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房间自我介绍环节表';
  497. -- 默契问答
  498. CREATE TABLE `room_phase_question` (
  499. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间默契问答环节编号',
  500. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  501. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  502. `total` bigint(20) unsigned NOT NULL COMMENT '选题数量',
  503. `choose_same_count` bigint(20) unsigned NOT NULL COMMENT '选择一样选题数量',
  504. `video_tip` varchar(256) DEFAULT NULL COMMENT '视频提示',
  505. `audio_tip` varchar(256) DEFAULT NULL COMMENT '音频提示',
  506. `wait_sec` bigint(20) unsigned NOT NULL DEFAULT 2 COMMENT '等待时间',
  507. `countdown_sec` bigint(20) unsigned NOT NULL COMMENT '每个题目倒计时',
  508. PRIMARY KEY (`room_phase_id`)
  509. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房间默契问答环节表';
  510. CREATE TABLE `room_question` (
  511. `room_question_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间题目编号',
  512. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间默契问答环节编号',
  513. `template_question_id` bigint(20) unsigned NOT NULL COMMENT '模板题目编号',
  514. `num` bigint(20) unsigned NOT NULL COMMENT '第几题目',
  515. `state` tinyint(4) unsigned NOT NULL COMMENT '选择状态, 见QuestionChooseStateEnum',
  516. `user_choose` varchar(1) DEFAULT NULL COMMENT '发起用户选择',
  517. `match_user_choose` varchar(1) DEFAULT NULL COMMENT '配对用户选择',
  518. `begin_time` DATETIME DEFAULT NULL COMMENT '配对用户开始时间',
  519. `end_time` DATETIME DEFAULT NULL COMMENT '配对用户截止时间',
  520. PRIMARY KEY (`room_question_id`)
  521. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间题目表';
  522. -- 自由交流
  523. CREATE TABLE `room_phase_communication` (
  524. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间自由交流环节编号',
  525. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  526. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  527. `countdown_sec` bigint(20) unsigned NOT NULL COMMENT '倒计时',
  528. `mic_type` tinyint(4) unsigned NOT NULL COMMENT '麦位展示类型, 见MicTypeEnum',
  529. `begin_time` DATETIME DEFAULT NULL COMMENT '自由交流开始时间',
  530. `end_time` DATETIME DEFAULT NULL COMMENT '自由交流截止时间',
  531. PRIMARY KEY (`room_phase_id`)
  532. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房间自由交流环节表';
  533. -- 最终选择
  534. CREATE TABLE `room_phase_choose` (
  535. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间最终选择环节编号',
  536. `start_tip` varchar(256) DEFAULT NULL COMMENT '开始提示',
  537. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  538. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  539. `countdown_sec` bigint(20) unsigned NOT NULL COMMENT '每个题目倒计时',
  540. `begin_time` DATETIME DEFAULT NULL COMMENT '开始时间',
  541. `end_time` DATETIME DEFAULT NULL COMMENT '截止时间',
  542. `user_choose_result` tinyint(4) unsigned NOT NULL COMMENT '选择结果, 见ChooseResultEnum',
  543. `match_user_choose_result` tinyint(4) unsigned NOT NULL COMMENT '选择结果, 见ChooseResultEnum',
  544. PRIMARY KEY (`room_phase_id`)
  545. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房间最终选择环节表';
  546. -- 最后留下
  547. CREATE TABLE `room_phase_stay` (
  548. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '房间最后留下环节编号',
  549. `start_audio_path` varchar(256) DEFAULT NULL COMMENT '开始音频文件',
  550. `start_audio_sec` bigint(20) unsigned NOT NULL COMMENT '开始音频时长(秒)',
  551. `countdown_sec` bigint(20) unsigned NOT NULL COMMENT '每个题目倒计时',
  552. `begin_time` DATETIME DEFAULT NULL COMMENT '开始时间',
  553. `end_time` DATETIME DEFAULT NULL COMMENT '截止时间',
  554. PRIMARY KEY (`room_phase_id`)
  555. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='房间最后留下环节表';
  556. CREATE TABLE `cp_show` (
  557. `show_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '专场编号',
  558. `type` tinyint(4) unsigned NOT NULL COMMENT '专场类型,CpShowTypeEnum',
  559. `min_bean` bigint(20) unsigned NOT NULL COMMENT '竞价最少红豆数',
  560. `hostess_user_id` bigint(20) unsigned NOT NULL COMMENT '主持用户编号',
  561. `male_user_id` bigint(20) unsigned NOT NULL COMMENT '男嘉宾用户编号',
  562. `female1_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾1号用户编号',
  563. `female2_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾2号用户编号',
  564. `female3_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾3号用户编号',
  565. `female4_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾4号用户编号',
  566. `apply_end_time` DATETIME DEFAULT NULL COMMENT '报名截止时间',
  567. `begin_time` DATETIME DEFAULT NULL COMMENT '开始时间',
  568. `state` tinyint(4) unsigned NOT NULL COMMENT '专场状态,CpShowStateEnum',
  569. `room_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '房间编号',
  570. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  571. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  572. PRIMARY KEY (`show_id`)
  573. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='专场表';
  574. CREATE TABLE `cp_show_candidate` (
  575. `candidate_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '专场报名编号',
  576. `show_id` bigint(20) unsigned NOT NULL COMMENT '专场编号',
  577. `user_id` bigint(20) unsigned NOT NULL COMMENT '报名用户编号',
  578. `type` tinyint(4) unsigned NOT NULL COMMENT '专场报名类型,CpShowCandidateTypeEnum',
  579. `bean` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '竞价消耗红豆数量',
  580. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  581. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  582. PRIMARY KEY (`candidate_id`)
  583. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='专场报名表';
  584. CREATE TABLE `cp_show_candidate_bidding` (
  585. `bidding_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '专场报名竞价编号',
  586. `candidate_id` bigint(20) unsigned NOT NULL COMMENT '专场报名编号',
  587. `show_id` bigint(20) unsigned NOT NULL COMMENT '专场编号',
  588. `user_id` bigint(20) unsigned NOT NULL COMMENT '报名用户编号',
  589. `bean` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '竞价消耗红豆数量',
  590. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  591. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  592. PRIMARY KEY (`bidding_id`)
  593. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='专场报名竞价表';
  594. CREATE TABLE `room_show` (
  595. `room_id` bigint(20) unsigned NOT NULL COMMENT '专场房间编号',
  596. `show_id` bigint(20) unsigned NOT NULL COMMENT '专场编号',
  597. `type` tinyint(4) unsigned NOT NULL COMMENT '专场类型,CpShowTypeEnum',
  598. `view_user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '导播视角用户编号',
  599. `hostess_user_id` bigint(20) unsigned NOT NULL COMMENT '主持用户编号',
  600. `male_user_id` bigint(20) unsigned NOT NULL COMMENT '男嘉宾用户编号',
  601. `female1_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾1号用户编号',
  602. `female2_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾2号用户编号',
  603. `female3_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾3号用户编号',
  604. `female4_user_id` bigint(20) unsigned NOT NULL COMMENT '女嘉宾4号用户编号',
  605. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  606. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  607. PRIMARY KEY (`room_id`)
  608. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专场房间表';
  609. CREATE TABLE `room_show_female` (
  610. `room_female_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间女嘉宾编号',
  611. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  612. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  613. `light_num` bigint(20) unsigned NOT NULL DEFAULT 3 COMMENT '亮灯数量',
  614. `male_enter_light_state` tinyint(4) unsigned NOT NULL COMMENT '男嘉宾进场灯状态,RoomLightStateEnum',
  615. `female_question_light_state` tinyint(4) unsigned NOT NULL COMMENT '女嘉宾提问灯状态,RoomLightStateEnum',
  616. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  617. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  618. PRIMARY KEY (`room_female_id`)
  619. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间女嘉宾编号';
  620. CREATE TABLE `room_show_male` (
  621. `room_male_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '房间男嘉宾编号',
  622. `room_id` bigint(20) unsigned NOT NULL COMMENT '房间编号',
  623. `user_id` bigint(20) unsigned NOT NULL COMMENT '用户编号',
  624. `heart_user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '心动女生编号',
  625. `choose_user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '最终选择女生编号',
  626. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  627. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  628. PRIMARY KEY (`room_male_id`)
  629. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='房间男嘉宾编号';
  630. -- 开始
  631. CREATE TABLE `room_phase_first` (
  632. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  633. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  634. PRIMARY KEY (`room_phase_id`)
  635. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开始环节表';
  636. -- 结束
  637. CREATE TABLE `room_phase_last` (
  638. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  639. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  640. PRIMARY KEY (`room_phase_id`)
  641. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='结束环节表';
  642. CREATE TABLE `room_phase_male_enter` (
  643. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  644. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  645. PRIMARY KEY (`room_phase_id`)
  646. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='男嘉宾进场环节表';
  647. CREATE TABLE `room_phase_female_enter` (
  648. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  649. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  650. PRIMARY KEY (`room_phase_id`)
  651. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='女嘉宾进场环节表';
  652. CREATE TABLE `room_phase_male_heart` (
  653. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  654. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  655. PRIMARY KEY (`room_phase_id`)
  656. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='男嘉宾选择心动女生环节表';
  657. CREATE TABLE `room_phase_female_question` (
  658. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  659. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  660. PRIMARY KEY (`room_phase_id`)
  661. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='女嘉宾提问环节表';
  662. CREATE TABLE `room_phase_male_question` (
  663. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  664. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  665. PRIMARY KEY (`room_phase_id`)
  666. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='男嘉宾提问环节表';
  667. CREATE TABLE `room_phase_male_choose` (
  668. `room_phase_id` bigint(20) unsigned NOT NULL COMMENT '环节编号',
  669. `title` varchar(256) DEFAULT NULL COMMENT '标题',
  670. PRIMARY KEY (`room_phase_id`)
  671. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='男嘉宾最终选择环节表';
  672. -- 不要脱单星球活动
  673. CREATE TABLE `activity_star_member` (
  674. `star_member_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '星球成员编号',
  675. `openid` varchar(64) DEFAULT NULL COMMENT '微信openid',
  676. `unionid` varchar(64) DEFAULT NULL COMMENT '微信unionid',
  677. `username` varchar(16) NOT NULL COMMENT '姓名',
  678. `phone` varchar(11) NOT NULL COMMENT '手机号码',
  679. `wechat` varchar(64) NOT NULL COMMENT '微信号',
  680. `type` tinyint(4) unsigned NOT NULL COMMENT '类型,见StarMemberTypeEnum',
  681. `state` tinyint(4) unsigned NOT NULL COMMENT '状态,见StarMemberStateEnum',
  682. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  683. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  684. PRIMARY KEY (`star_member_id`)
  685. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='脱单星球活动报名表';
  686. CREATE TABLE `sys_interest_tag` (
  687. `interest_tag_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '个性标签编号',
  688. `group` varchar(16) NOT NULL COMMENT '个性标签分组',
  689. `name` varchar(64) NOT NULL COMMENT '个性标签名称',
  690. `state` tinyint(4) unsigned NOT NULL COMMENT '状态,见InterestTagStateEnum',
  691. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  692. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  693. PRIMARY KEY (`interest_tag_id`)
  694. ) ENGINE=InnoDB AUTO_INCREMENT=1000000001 DEFAULT CHARSET=utf8mb4 COMMENT='个性标签表';
  695. CREATE TABLE `sys_topic` (
  696. `topic_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '话题编号',
  697. `name` varchar(64) NOT NULL COMMENT '名称',
  698. `image_url` varchar(256) DEFAULT NULL COMMENT '图片地址',
  699. `recommend` tinyint(4) unsigned NOT NULL COMMENT '推荐标识,见TopicTagRecommendEnum',
  700. `hot` tinyint(4) unsigned NOT NULL COMMENT '热门标识,见TopicTagHotEnum',
  701. `top` tinyint(4) unsigned NOT NULL COMMENT '置顶标识,见TopicTagTopEnum',
  702. `sort_flag` int(11) unsigned NOT NULL COMMENT '排序',
  703. `state` tinyint(4) unsigned NOT NULL COMMENT '状态,见TopicStateEnum',
  704. `create_user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '创建用户编号',
  705. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  706. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  707. PRIMARY KEY (`topic_id`)
  708. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='话题表';
  709. CREATE TABLE `sys_occupation` (
  710. `occupation_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '职业编号',
  711. `parent_occupation_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '父职业编号',
  712. `name` varchar(64) NOT NULL COMMENT '名称',
  713. `sort_flag` int(11) unsigned NOT NULL COMMENT '排序',
  714. `state` tinyint(4) unsigned NOT NULL COMMENT '状态,见OccupationStateEnum',
  715. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  716. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  717. PRIMARY KEY (`occupation_id`)
  718. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='职业表';
  719. CREATE TABLE `sys_sensitive_words` (
  720. `sensitive_words_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '敏感词编号',
  721. `sensitive_words` varchar(64) NOT NULL COMMENT '敏感词',
  722. `admin_id` bigint(20) unsigned NOT NULL COMMENT '管理员编号',
  723. `gmt_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  724. `gmt_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  725. PRIMARY KEY (`sensitive_words_id`)
  726. ) ENGINE=InnoDB AUTO_INCREMENT=10000001 DEFAULT CHARSET=utf8mb4 COMMENT='敏感词表';