modifyhistory.sql 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. ALTER TABLE `friendship`.`user_friend`
  2. DROP COLUMN `type`,
  3. ADD COLUMN `type` tinyint(2) NULL COMMENT '类型' AFTER `status`;
  4. CREATE TABLE `friendship`.`image_card_recommand` (
  5. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  6. `image_card_id` bigint(20) NULL DEFAULT NULL COMMENT '形象卡id',
  7. `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  8. `user_gender` tinyint(2) NULL DEFAULT NULL COMMENT '用户性别',
  9. `create_time` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  10. PRIMARY KEY (`id`) USING BTREE
  11. ) ENGINE = InnoDB AUTO_INCREMENT = 11001010 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '形象卡推荐表' ROW_FORMAT = Dynamic;
  12. --2020-03-16 10:00
  13. ALTER TABLE `friendship`.`user_account`
  14. ADD COLUMN `system_give_away_beans` integer(15) NULL COMMENT '系统赠送的u豆数' AFTER `update_time`;
  15. -- 2020-03-16 15:10
  16. ALTER TABLE `friendship`.`user_login`
  17. ADD COLUMN `channel` varchar(32) NULL COMMENT '下载的渠道' AFTER `device_token`;
  18. ALTER TABLE `friendship`.`user`
  19. ADD COLUMN `channel` varchar(32) NULL COMMENT '下载的渠道' AFTER `device_token`;
  20. ALTER TABLE `friendship`.`user_info`
  21. ADD COLUMN `declaration` varchar(64) NULL COMMENT '交友宣言' AFTER `township`;
  22. --2020-03-28 10:00
  23. CREATE TABLE `friendship`.`Untitled` (
  24. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  25. `type` tinyint(2) NULL COMMENT '座驾类型',
  26. `beans` integer(10) NULL COMMENT '兑换的U豆',
  27. `level` integer(4) NULL COMMENT '财富登记',
  28. `oil_card` integer(4) NULL COMMENT '油卡',
  29. `car_url` varchar(300) NULL COMMENT '油卡url',
  30. `status` tinyint(2) NULL COMMENT '状态',
  31. PRIMARY KEY (`id`)
  32. );
  33. ALTER TABLE `friendship`.`car`
  34. ADD COLUMN `create_time` timestamp(0) NULL COMMENT '创建时间' AFTER `status`;
  35. CREATE TABLE `friendship`.`user_car_middle` (
  36. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  37. `user_id` bigint(20) NULL COMMENT '用户id',
  38. `car_id` bigint(20) NULL COMMENT '座驾id',
  39. PRIMARY KEY (`id`)
  40. ) ENGINE = InnoDB AUTO_INCREMENT = 10001000;
  41. CREATE TABLE `friendship`.`user_car` (
  42. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  43. `wealth_level` integer(10) NULL COMMENT '财富级别',
  44. `oil_card` integer(10) NULL COMMENT '我的油卡',
  45. `current_car_id` bigint(20) NULL COMMENT '驾驶中的座驾',
  46. PRIMARY KEY (`id`)
  47. ) ENGINE = InnoDB AUTO_INCREMENT = 10001000;
  48. ALTER TABLE `friendship`.`car`
  49. ADD COLUMN `default_car` tinyint(2) NULL DEFAULT 0 COMMENT '默认座驾' AFTER `create_time`;
  50. ALTER TABLE `friendship`.`car`
  51. CHANGE COLUMN `level` `wealth_level` int(4) NULL DEFAULT NULL COMMENT '财富等级' AFTER `beans`;
  52. ALTER TABLE `friendship`.`user_car`
  53. ADD COLUMN `user_id` bigint(20) NULL COMMENT '用户id' AFTER `current_car_id`,
  54. ADD UNIQUE INDEX `userId`(`user_id`) USING BTREE;
  55. -- 2020-03-30
  56. CREATE TABLE `friendship`.`user_daily_receive_oilcard_detail` (
  57. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  58. `user_id` bigint(20) NULL COMMENT '用户id',
  59. `oil_card` tinyint(10) NULL COMMENT '油卡数',
  60. `receive_date` timestamp(0) NULL COMMENT '领取日期',
  61. PRIMARY KEY (`id`)
  62. ) ENGINE = InnoDB AUTO_INCREMENT = 10001000;
  63. ALTER TABLE `friendship`.`user_daily_receive_oilcard_detail` COMMENT = '用户油卡领取详情';
  64. -- modify user_car
  65. ALTER TABLE `friendship`.`user_car`
  66. ADD COLUMN `user_improveInformation_receive_oilcard_status` tinyint(2) NULL COMMENT '完善个人信息领取油卡详情' AFTER `user_id`,
  67. ADD COLUMN `user_publish_imagecard_status` tinyint(2) NULL COMMENT '用户发布形象卡领取油卡状态' AFTER `user_improveInformation_receive_oilcard_status`;
  68. ALTER TABLE `friendship`.`user_car`
  69. MODIFY COLUMN `user_improveInformation_receive_oilcard_status` tinyint(2) NULL DEFAULT 0 COMMENT '完善个人信息领取油卡详情' AFTER `user_id`,
  70. MODIFY COLUMN `user_publish_imagecard_status` tinyint(2) NULL DEFAULT 0 COMMENT '用户发布形象卡领取油卡状态' AFTER `user_improveInformation_receive_oilcard_status`;
  71. ALTER TABLE `friendship`.`user_car`
  72. MODIFY COLUMN `wealth_level` int(10) NULL DEFAULT 1 COMMENT '财富级别' AFTER `id`;
  73. ALTER TABLE `friendship`.`user_car`
  74. ADD COLUMN `pickup_times` integer(6) NULL DEFAULT 0 COMMENT '每日油卡领取次数' AFTER `user_publish_imagecard_status`;
  75. -- modify system-config
  76. INSERT INTO `friendship`.`system_config`(`id`, `name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES (10001009, '每日领取的油卡', '100', NULL, '2020-03-30 14:57:41', NULL, 'MRLQYK');
  77. INSERT INTO `friendship`.`system_config`(`id`, `name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES (10001010, '发布形象卡获取的油卡', '50', NULL, '2020-03-30 14:58:28', NULL, 'FBXXKHQYK');
  78. INSERT INTO `friendship`.`system_config`(`id`, `name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES (10001011, '完善基本信息获取油卡', '50', NULL, '2020-03-30 14:59:02', NULL, 'WSXXDYK');
  79. -- modify user_car_middle 2020-04-02
  80. ALTER TABLE `friendship`.`user_car_middle`
  81. ADD COLUMN `create_time` timestamp(0) NULL COMMENT '创建时间' AFTER `car_id`;
  82. -- 2020-04-02
  83. CREATE TABLE `friendship`.`fatelink_history` (
  84. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  85. `user_id` bigint(20) NULL COMMENT '用户id',
  86. `fatelink_user_id` bigint(20) NULL COMMENT '连接的用户id',
  87. `create_time` timestamp(0) NULL COMMENT '创建时间',
  88. PRIMARY KEY (`id`)
  89. ) ENGINE = InnoDB AUTO_INCREMENT = 11001011;
  90. ALTER TABLE `friendship`.`fatelink_history`
  91. ADD UNIQUE INDEX `userIdMatchuserId`(`user_id`, `fatelink_user_id`) USING BTREE COMMENT '用户id和匹配到的用户id';
  92. -- 2020-04-03
  93. ALTER TABLE `friendship`.`car`
  94. ADD COLUMN `car_name` varchar(16) NULL COMMENT '座驾名称' AFTER `default_car`;
  95. ALTER TABLE `friendship`.`car`
  96. DROP COLUMN `default_car`;
  97. -- 2020-04-07
  98. CREATE TABLE `friendship`.`chat_room` (
  99. `id` bigint(20) NULL COMMENT '主键',
  100. `chat_room_user` varchar(40) NULL COMMENT '聊天室用户',
  101. `chat_room_id` varchar(50) NULL COMMENT '聊天室id',
  102. `create_time` timestamp(0) NULL COMMENT '创建时间',
  103. UNIQUE INDEX `userId`(`chat_room_user`(20)) USING BTREE COMMENT '用户id创建索引'
  104. ) ENGINE = InnoDB AUTO_INCREMENT = 10001000;
  105. ALTER TABLE `friendship`.`chat_room` COMMENT = '聊天室详情表';
  106. ALTER TABLE `friendship`.`user`
  107. ADD COLUMN `user_identifier` varchar(64) NULL COMMENT '苹果id身份信息' AFTER `device_token`;
  108. ALTER TABLE `friendship`.`user`
  109. ADD COLUMN `full_name` varchar(32) NULL COMMENT '苹果的fullname' AFTER `user_identifier`;
  110. ALTER TABLE `friendship`.`user`
  111. DROP INDEX `idxIdPhone`,
  112. DROP INDEX `useridx`,
  113. ADD UNIQUE INDEX `idxIdPhone`(`id`, `phone`) USING BTREE,
  114. ADD UNIQUE INDEX `useridx`(`id`) USING BTREE,
  115. ADD UNIQUE INDEX `userIdentifier`(`user_identifier`(30)) USING BTREE;
  116. -- 新增表2020-04-08
  117. CREATE TABLE `friendship`.`report` (
  118. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  119. `report_user_id` bigint(20) NULL COMMENT '举报的用户id',
  120. `Reported_user_id` bigint(20) NULL COMMENT '被举报的用户id',
  121. `report_content` varchar(16) NULL COMMENT '举报内容',
  122. `create_time` datetime(0) NULL COMMENT '创建时间',
  123. `update_time` datetime(0) NULL COMMENT '更新时间',
  124. `status` tinyint(2) NULL COMMENT '处理状态',
  125. `type` tinyint(2) NULL COMMENT '举报内容分类',
  126. PRIMARY KEY (`id`)
  127. ) ENGINE = InnoDB AUTO_INCREMENT = 11001001 COMMENT = '举报内容表';
  128. -- 2020-04-08 9:44
  129. CREATE TABLE `friendship`.`group` (
  130. `id` bigint(20) NULL COMMENT '主键',
  131. `group_topic_id` varchar(40) NULL COMMENT '群聊关联话题id',
  132. `group_id` varchar(50) NULL COMMENT '群聊id',
  133. `create_time` timestamp(0) NULL COMMENT '创建时间',
  134. UNIQUE INDEX `topicId`(`group_topic_id`(20)) USING BTREE COMMENT '话题id创建索引'
  135. ) ENGINE = InnoDB AUTO_INCREMENT = 10010101;
  136. ALTER TABLE `friendship`.`group` COMMENT = '群聊详情表';
  137. -- 2020-04-08 17:52
  138. CREATE TABLE `friendship`.`group_user` (
  139. `id` bigint(20) NULL COMMENT '主键',
  140. `group_user` varchar(40) NULL COMMENT '群组用户',
  141. `group_id` varchar(50) NULL COMMENT '群组id',
  142. UNIQUE INDEX `userId`(`group_user`(20)) USING BTREE COMMENT '用户id创建索引'
  143. ) ENGINE = InnoDB AUTO_INCREMENT = 10011101;
  144. ALTER TABLE `friendship`.`group_user` COMMENT = '群组用户中间表';
  145. -- 2020-04-09 14:10
  146. ALTER TABLE `friendship`.`topic`
  147. ADD COLUMN `cover_img` varchar(255) NULL DEFAULT NULL COMMENT '背景图片地址' AFTER `status`;
  148. -- 创建索引
  149. ALTER TABLE `friendship`.`works`
  150. ADD UNIQUE INDEX `userIdCreateTime`(`author_id`, `create_time`) USING BTREE;
  151. ALTER TABLE `friendship`.`user_image_card_like_detail`
  152. ADD UNIQUE INDEX `userIdAuthorId`(`user_id`, `image_card_author`) USING BTREE COMMENT '用户id和作者id';
  153. ALTER TABLE `friendship`.`little_note`
  154. MODIFY COLUMN `image_card_id` bigint(20) NULL DEFAULT NULL COMMENT '形象卡id' AFTER `user_id`,
  155. ADD INDEX `image_card_id`(`image_card_id`) USING BTREE COMMENT '为形象卡id添加索引';
  156. ALTER TABLE `friendship`.`user_image_card_pictures`
  157. ADD UNIQUE INDEX `userIdSeq`(`user_id`, `seq`) USING BTREE COMMENT '用户id序号创建索引';
  158. ALTER TABLE `friendship`.`works`
  159. DROP INDEX `userIdCreateTime`,
  160. ADD INDEX `userIdCreateTime`(`author_id`) USING BTREE;
  161. ALTER TABLE `friendship`.`user_info`
  162. ADD COLUMN `hobbies` varchar(64) NULL COMMENT '爱好' AFTER `declaration`,
  163. ADD COLUMN `tags` varchar(64) NULL COMMENT '标签' AFTER `hobbies`;
  164. ALTER TABLE `friendship`.`user_info`
  165. ADD COLUMN `last_work_content` varchar(255) NULL COMMENT '最后一条作品的内容' AFTER `township`;
  166. ALTER TABLE `friendship`.`image_card_recommand`
  167. ADD COLUMN `oss_prefix` varchar(128) NULL COMMENT 'oss前缀' AFTER `create_time`,
  168. ADD COLUMN `recommand_imagecard_urls` varchar(1024) NULL COMMENT '推荐列表' AFTER `oss_prefix`;
  169. ALTER TABLE `friendship`.`image_card_recommand`
  170. ADD COLUMN `video_cover_image` varchar(128) NULL COMMENT '视频封面' AFTER `recommand_imagecard_urls`;
  171. -- 2020-04-11
  172. SET NAMES utf8mb4;
  173. SET FOREIGN_KEY_CHECKS = 0;
  174. -- ----------------------------
  175. -- Table structure for user_device
  176. -- ----------------------------
  177. /*
  178. Navicat Premium Data Transfer
  179. Source Server : 测试环境
  180. Source Server Type : MySQL
  181. Source Server Version : 50721
  182. Source Host : 120.79.211.173:3306
  183. Source Schema : bore
  184. Target Server Type : MySQL
  185. Target Server Version : 50721
  186. File Encoding : 65001
  187. Date: 11/04/2020 11:21:01
  188. */
  189. SET NAMES utf8mb4;
  190. SET FOREIGN_KEY_CHECKS = 0;
  191. -- ----------------------------
  192. -- Table structure for user_device
  193. -- ----------------------------
  194. DROP TABLE IF EXISTS `user_device`;
  195. CREATE TABLE `user_device` (
  196. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '逻辑主键',
  197. `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户编号(用户未绑定则为0)',
  198. `device_id` varchar(64) NOT NULL COMMENT '设备唯一码',
  199. `idfa` varchar(64) DEFAULT NULL COMMENT '苹果IDFA(广告标识符)',
  200. `imei` varchar(64) DEFAULT NULL COMMENT '安卓IMEI',
  201. `oaid` varchar(64) DEFAULT NULL COMMENT '安卓OAID',
  202. `androidid` varchar(64) DEFAULT NULL COMMENT '安卓AndroidId',
  203. `ip` varchar(128) NOT NULL COMMENT '用户IP',
  204. `channel` varchar(64) NOT NULL COMMENT '下载渠道',
  205. `client` varchar(32) NOT NULL COMMENT '客户端',
  206. `advertiser` varchar(32) COMMENT '广告商',
  207. `advertiser_id` bigint(20) unsigned DEFAULT NULL COMMENT '广告商主键',
  208. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  209. PRIMARY KEY (`id`),
  210. KEY `device_id` (`device_id`)
  211. ) ENGINE=InnoDB AUTO_INCREMENT=10000054 DEFAULT CHARSET=utf8mb4 COMMENT='内部设备唯一码表';
  212. SET FOREIGN_KEY_CHECKS = 1;
  213. -- 2020-04-10 11:03
  214. DROP TABLE `friendship`.`topic_note`;
  215. CREATE TABLE `friendship`.`private_note` (
  216. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  217. `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  218. `create_time` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间',
  219. `content` varchar(300) NULL DEFAULT NULL COMMENT '内容',
  220. PRIMARY KEY (`id`) USING BTREE
  221. ) ENGINE = InnoDB AUTO_INCREMENT = 11002121 COMMENT = '私人模式纸条表';
  222. -- 2020-04-10 20:25
  223. ALTER TABLE `friendship`.`topic_voice_barrage`
  224. ADD COLUMN `is_private` tinyint(2) NULL DEFAULT 1 COMMENT '是否属于私人模式0:属于,1:不属于' AFTER `release_time`;
  225. -- 2020-04-11 15:31
  226. ALTER TABLE `friendship`.`group`
  227. ADD COLUMN `group_name` varchar(120) NULL DEFAULT NULL COMMENT '群组名称' AFTER `group_id`;
  228. -- 2020-04-13 9:45
  229. ALTER TABLE `friendship`.`topic_voice_barrage`
  230. MODIFY COLUMN `voice_duration` int(10) NULL DEFAULT NULL COMMENT '音轨长度' AFTER `voice_url`;
  231. -- 2020-04-13 12:00 修改作品文案表
  232. ALTER TABLE `friendship`.`work_template`
  233. DROP COLUMN `dic_item_id`,
  234. DROP COLUMN `title`,
  235. DROP COLUMN `author`;
  236. -- 2020-04-13 16:00 修改作品表
  237. ALTER TABLE `friendship`.`works`
  238. CHANGE COLUMN `title` `picture_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '背景图片地址' AFTER `author_id`;
  239. -- 2020-04-13 16:00 修改用户信息表
  240. ALTER TABLE `friendship`.`user_info`
  241. DROP COLUMN `last_work_content`;
  242. --2020-04-13 17:00
  243. ALTER TABLE `friendship`.`report`
  244. CHANGE COLUMN `Reported_user_id` `Reported_id` bigint(20) NULL DEFAULT NULL COMMENT '被举报的id' AFTER `report_user_id`;
  245. MODIFY COLUMN `voice_duration` int(10) NULL DEFAULT NULL COMMENT '音轨长度(秒)' AFTER `voice_url`;
  246. -- 2020-04-13 15:07
  247. CREATE TABLE `friendship`.`user_thumb_topic_voice_barrage` (
  248. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  249. `user_id` bigint(20) NOT NULL COMMENT '点赞用户id',
  250. `thumb_voice_barrage_id` bigint(20) DEFAULT NULL COMMENT '点赞的语音弹幕id',
  251. `update_time` timestamp NULL DEFAULT NULL COMMENT '操作时间',
  252. PRIMARY KEY (`id`)
  253. ) ENGINE=InnoDB AUTO_INCREMENT=10022021 DEFAULT CHARSET=utf8mb4 COMMENT='用户点赞话题中语音弹幕表';
  254. ALTER TABLE `friendship`.`report` CHANGE COLUMN
  255. `Reported_user_id` `Reported_id` bigint(20) NULL DEFAULT NULL COMMENT '被举报的id' AFTER `report_user_id`;
  256. -- 2020-04-14 14:41
  257. create table `friendship`.`topic_mood_skin`(
  258. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  259. `mood_skin_url` varchar(128) NULL DEFAULT NULL COMMENT '心情皮肤地址',
  260. PRIMARY KEY (`id`) USING BTREE
  261. ) ENGINE=InnoDB AUTO_INCREMENT=10102021 DEFAULT CHARSET=utf8mb4 COMMENT='心情皮肤';
  262. -- 2020-04-15 10:26
  263. ALTER TABLE `friendship`.`topic_voice_barrage`
  264. ADD COLUMN `mood_skin_id` bigint(20) NULL DEFAULT NULL COMMENT '心情皮肤' AFTER `topic_id`;
  265. ALTER TABLE `friendship`.`user_thumb_topic_voice_barrage`
  266. ADD COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '点赞状态0:点赞,1:取消点赞' AFTER `thumb_voice_barrage_id`;
  267. -- 2020-04-16 15:33
  268. create table `friendship`.`user_collect_topic`(
  269. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  270. `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  271. `topic_id` bigint(20) NULL DEFAULT NULL COMMENT '话题id',
  272. `status` tinyint(2) NULL DEFAULT 0 COMMENT '收藏状态0:收藏,1:取消收藏',
  273. `update_time` timestamp NULL DEFAULT NULL COMMENT '操作时间',
  274. PRIMARY KEY (`id`) USING BTREE
  275. ) ENGINE=InnoDB AUTO_INCREMENT=10121121 DEFAULT CHARSET=utf8mb4 COMMENT='用户收藏话题表';
  276. ADD COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '点赞状态0:点赞,1:取消点赞' AFTER `topic_id`;
  277. -- 2020-04-26 11:20
  278. ALTER TABLE `friendship`.`user_like_miss`
  279. ADD INDEX `worksId`(`works_id`) USING BTREE COMMENT '作品id添加索引';
  280. ALTER TABLE `friendship`.`user_like_miss`
  281. DROP INDEX `worksId`,
  282. ADD INDEX `worksId`(`works_id`, `type`) USING BTREE COMMENT '作品id添加索引';
  283. -- 2020-04-16 :16:30 创建融云消息记录表
  284. CREATE TABLE `friendship`.`rong_chat_history` (
  285. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  286. `from_user_id` bigint(10) NULL COMMENT '发送人',
  287. `to_user_id` bigint(10) NULL COMMENT '收到消息的用户id,如果是群聊那么保存',
  288. `content` varchar(255) NULL COMMENT '消息内容',
  289. `msg_UID` varchar(32) NULL COMMENT '消息唯一id',
  290. `source` varchar(16) NULL COMMENT '来源',
  291. `sensitive_type` tinyint(2) NULL COMMENT '敏感词信息',
  292. `object_name` varchar(16) NULL COMMENT '消息类型',
  293. `channel_type` varchar(16) NULL COMMENT '会话类型',
  294. `group_user_id` bigint(10) NULL COMMENT '群组id',
  295. `create_time` timestamp(0) NULL COMMENT '创建时间',
  296. PRIMARY KEY (`id`),
  297. UNIQUE INDEX `fromUserContentCreateTime`(`from_user_id`, `content`(15), `create_time`) USING BTREE COMMENT '发送者内容和时间做唯一索引'
  298. ) COMMENT = '融云聊天记录表';
  299. ALTER TABLE `friendship`.`rong_chat_history`
  300. ADD COLUMN `rong_id` varchar(32) NULL COMMENT '聊天室/群聊的房间id' AFTER `create_time`;
  301. ALTER TABLE `friendship`.`rong_chat_history`
  302. DROP INDEX `fromUserContentCreateTime`,
  303. ADD INDEX `fromUserContentCreateTime`(`from_user_id`, `content`(15), `create_time`) USING BTREE COMMENT '发送者内容和时间做唯一索引';
  304. -- 2020 04-17
  305. ALTER TABLE `friendship`.`user_info`
  306. DROP COLUMN `declaration`;
  307. ALTER TABLE `friendship`.`fatelink_history`
  308. ADD COLUMN `chat_room_id` varchar(32) NULL COMMENT '聊天室id' AFTER `create_time`;
  309. ALTER TABLE `friendship`.`user_car`
  310. ADD COLUMN `first_fatelink` tinyint(2) NULL COMMENT '是否首次连接' AFTER `pickup_times`;
  311. update user_car set first_fatelink = 0;
  312. -- 2020 04-18
  313. CREATE TABLE `friendship`.`user_private_topic_background_picture` (
  314. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  315. `user_id` bigint(10) NULL COMMENT '用户id',
  316. `bgpicture_id` bigint(10) NULL COMMENT '背景图片id',
  317. PRIMARY KEY (`id`)
  318. )ENGINE=InnoDB AUTO_INCREMENT=10211021 DEFAULT CHARSET=utf8mb4 COMMENT = '私人模式背景图片关系表';
  319. ALTER TABLE `friendship`.`user_private_topic_background_picture`
  320. ADD INDEX `user_id`(`user_id`) USING BTREE COMMENT '为用户id添加索引';
  321. -- 2020-04-20 18:00
  322. ALTER TABLE `friendship`.`user_image_card`
  323. DROP COLUMN `is_fill`,
  324. ADD COLUMN `is_fill` tinyint(2) NULL DEFAULT 0 COMMENT '视频是否撑满全屏' AFTER `update_time`;
  325. -- 2020 -4-20 23:30
  326. ALTER TABLE `friendship`.`image_card_recommand`
  327. ADD UNIQUE INDEX `imagecardUserId`(`image_card_id`, `user_id`) USING BTREE COMMENT '形象卡用户id索引';
  328. ALTER TABLE `friendship`.`user_image_card_like_detail`
  329. DROP INDEX `userIdAuthorId`,
  330. ADD UNIQUE INDEX `userIdAuthorIdimageCardId`(`user_id`, `image_card_author`, `image_card_id`) USING BTREE COMMENT '用户id和作者id';
  331. ALTER TABLE `friendship`.`user_ios_subscription_receipt`
  332. MODIFY COLUMN `receipt` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '票据' AFTER `id`;
  333. ALTER TABLE `friendship`.`orders`
  334. ADD UNIQUE INDEX `payNo`(`pay_no`(20)) USING BTREE;
  335. ALTER TABLE `friendship`.`user_subscription_detail`
  336. ADD UNIQUE INDEX `originalTransactionalId`(`original_transaction_id`(10)) USING BTREE COMMENT '原始票据唯一索引';
  337. -- 2020-04-24 16:00
  338. ALTER TABLE `friendship`.`rong_chat_history`
  339. ADD COLUMN `current_status` tinyint(2) NULL DEFAULT 1 COMMENT '最新一次聊天记录状态' AFTER `rong_id`;
  340. -- 2020 -04- 25 9:21
  341. ALTER TABLE `friendship`.`user`
  342. DROP COLUMN `home_img`,
  343. ADD COLUMN `live_status` tinyint(2) NULL DEFAULT 0 COMMENT '直播状态' AFTER `full_name`,
  344. ADD COLUMN `has_lived` tinyint(2) NULL DEFAULT 0 COMMENT '是否直播过' AFTER `live_status`;
  345. CREATE TABLE `friendship`.`user_live_queue_receive` (
  346. `id` bigint(12) NULL COMMENT '主键',
  347. `user_id` bigint(20) NULL COMMENT '用户id',
  348. `message_id` varchar(32) NULL COMMENT '消息id',
  349. `create_time` timestamp(0) NULL COMMENT '创建时间',
  350. UNIQUE INDEX `userIdMessageId`(`user_id`, `message_id`) USING BTREE COMMENT '用户id与消息id唯一'
  351. );
  352. ALTER TABLE `friendship`.`user_live_queue_receive`
  353. MODIFY COLUMN `id` bigint(12) NOT NULL AUTO_INCREMENT COMMENT '主键' FIRST,
  354. ADD PRIMARY KEY (`id`);
  355. -- 2020-04-25 14:50
  356. CREATE TABLE `friendship`.`person_topic_salutation` (
  357. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  358. `salutation` varchar(300) NULL COMMENT '问候语',
  359. PRIMARY KEY (`id`) USING BTREE
  360. )ENGINE = InnoDB AUTO_INCREMENT = 10011231 DEFAULT CHARSET=utf8mb4 COMMENT = '个人模式问候语';
  361. -- 2020-04-26 10:30
  362. ALTER TABLE `friendship`.`bosom_detail`
  363. ADD UNIQUE INDEX `userIdTargetId`(`user_id`, `target_user_id`) USING BTREE COMMENT '用户和目标用户只能存在一个';
  364. ALTER TABLE `friendship`.`reward_detail`
  365. ADD INDEX `receiveUserIdGiftIdCreateTIme`(`receive_reward_user_id`, `gift_id`, `create_time`) USING BTREE;
  366. -- 2020-04-27 18:30
  367. CREATE TABLE `friendship`.`user_last_reviewd_imagecard` (
  368. `id` bigint(10) NOT NULL COMMENT 'id主键',
  369. `userId` bigint(20) NULL COMMENT '用户id',
  370. `last_verify_imagecard_pic` varchar(255) NULL COMMENT '最新审核通过的图片/视频封面的url',
  371. PRIMARY KEY (`id`),
  372. UNIQUE INDEX `userIdlastImageCardUrl`(`userId`, `last_verify_imagecard_pic`(10)) USING BTREE COMMENT '用户id和形象卡封面链接'
  373. );
  374. ALTER TABLE `friendship`.`user_last_reviewd_imagecard` COMMENT = '用户最新审核通过的形象卡封面';
  375. -- 2020-04-27 17:00
  376. INSERT INTO `friendship`.`person_topic_salutation`(`id`, `salutation`) VALUES (10001011, '忙碌了一天的你,想对自己说些什么呢?');
  377. -- 2020-04-28 17:30
  378. ALTER TABLE `friendship`.`user_subscription_detail`
  379. ADD COLUMN `transaction_id` varchar(32) NULL COMMENT '票据id' AFTER `original_transaction_id`;
  380. ALTER TABLE `friendship`.`user_subscription_detail`
  381. ADD COLUMN `auto_renew_change_time` timestamp(0) NULL COMMENT '订阅发生变化的时间' AFTER `auto_renew_product_id`;
  382. -- 2020-04-28 14:30
  383. ALTER TABLE `friendship`.`orders`
  384. DROP INDEX `payNo`,
  385. ADD UNIQUE INDEX `payNo`(`pay_no`(32)) USING BTREE;
  386. -- 2020-05-02 14:00
  387. alter table `group`
  388. drop index topicId,
  389. add index topicId (group_topic_id);
  390. alter table `group_user`
  391. drop index userId,
  392. add index userId (group_user);
  393. -- 2020-05-07 12:00
  394. drop table `user_package`
  395. ALTER TABLE `friendship`.`rong_chat_history`
  396. DROP INDEX `fromUserContentCreateTime`,
  397. ADD INDEX `fromUserContentCreateTime`(`from_user_id`, `content`(15), `create_time`) USING BTREE COMMENT '发送者内容和时间做唯一索引';
  398. -- 2020-05-08 12:00
  399. ALTER TABLE `friendship`.`user_account_with_draw_detail`
  400. MODIFY COLUMN `with_draw_amount` double(20, 2) NULL DEFAULT NULL COMMENT '提现金额' AFTER `user_card_id`;
  401. ALTER TABLE `friendship`.`rong_chat_history`
  402. MODIFY COLUMN `to_user_id` varchar(32) NULL DEFAULT NULL COMMENT '收到消息的用户id,如果是群聊那么保存' AFTER `from_user_id`;
  403. -- 2020-05-14 7:43
  404. ALTER TABLE `group`
  405. MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' FIRST,
  406. ADD PRIMARY KEY ( `id` );
  407. ALTER TABLE `group_user`
  408. MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键' FIRST,
  409. ADD PRIMARY KEY ( `id` );
  410. -- 2020-05-19 10:17
  411. CREATE TABLE `friendship`.`user_address_book` (
  412. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  413. `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
  414. `name` varchar(32) NULL DEFAULT NULL COMMENT '在通讯录中的昵称',
  415. `phone` varchar(16) NULL DEFAULT NULL COMMENT '手机号码',
  416. `is_exist` tinyint(2) NULL DEFAULT 0 COMMENT '存在用户通讯录状态0:存在,1:已被删除',
  417. PRIMARY KEY (`id`) USING BTREE
  418. ) ENGINE = InnoDB AUTO_INCREMENT = 10111221 COMMENT = '用户通讯录信息表';