V4.7.sql 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. -- 2020-08-19 动态评论表
  2. ALTER TABLE `friendship`.`dynamic_comment`
  3. ADD COLUMN `status` tinyint(2) NULL COMMENT '审核状态' AFTER `create_time`;
  4. ALTER TABLE `friendship`.`dynamic_comment_like_detail`
  5. ADD UNIQUE INDEX `idx_userId_commetnId`(`dynamic_comment_id`, `user_id`) USING BTREE COMMENT '用户id和评论id唯一索引';
  6. ALTER TABLE `friendship`.`dynamic_comment`
  7. MODIFY COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '审核状态' AFTER `create_time`;
  8. MODIFY COLUMN `status` tinyint(2) NULL DEFAULT 0 COMMENT '审核状态' AFTER `create_time`;/**/
  9. -- 修改广告商id
  10. ALTER TABLE `friendship`.`user_device`
  11. MODIFY COLUMN `advertiser_id` varchar(64) NULL DEFAULT NULL COMMENT '广告商主键' AFTER `advertiser`;
  12. ALTER TABLE `friendship`.`daily_dynamics`
  13. ADD COLUMN `recommend_time` timestamp(0) NULL COMMENT '推荐时间' AFTER `style`;
  14. -- 2020/08/25 10:56
  15. ALTER TABLE `friendship`.`user_device`
  16. ADD COLUMN `is_ad_activation` tinyint(2) NULL DEFAULT 1 COMMENT '广告渠道激活状态0:激活,1:未激活' AFTER `create_time`;
  17. ALTER TABLE `friendship`.`byte_dance_monitoring`
  18. MODIFY COLUMN `ua` varchar(200) null COMMENT 'ua' AFTER `ip`,
  19. MODIFY COLUMN `callback_url` varchar(300) null COMMENT '直接把调用事件回传接口的url生成出来,广告主可以直接使用' AFTER `ts`,
  20. MODIFY COLUMN `os` tinyint(2) null COMMENT '操作系统平台安卓:0,IOS:1,其他:3' AFTER `oaid`;
  21. ALTER TABLE `friendship`.`byte_dance_monitoring`
  22. DROP COLUMN `callback_url`,
  23. ADD COLUMN `callback_param` varchar(300) null COMMENT '一些跟广告信息相关的回调参数,内容是一个加密字符串,在调用事件回传接口的时候会用到' AFTER `ts`;
  24. -- 2020/08/31 11:03
  25. ALTER TABLE `friendship`.`byte_dance_monitoring`
  26. DROP COLUMN `aid_name`,
  27. DROP COLUMN `cid_name`,
  28. DROP COLUMN `campaign_id`,
  29. DROP COLUMN `campaign_name`,
  30. DROP COLUMN `ip`,
  31. DROP COLUMN `ua`,
  32. DROP COLUMN `model`;
  33. ALTER TABLE `friendship`.`user_device`
  34. ADD COLUMN `idfa_md5` varchar(64) NULL COMMENT '原idfa计算MD5,再转大写' AFTER `idfa`;
  35. -- 公会用户
  36. ALTER TABLE `friendship`.`club_user`
  37. ADD COLUMN `cancel_time` timestamp(0) NULL COMMENT '取消加入公会申请时间' AFTER `out_club_time`;
  38. -- 公会账户
  39. ALTER TABLE `friendship`.`club_account`
  40. ADD COLUMN `rate` double(2, 2) NULL COMMENT '分成比例' AFTER `update_time`;
  41. -- 平台详情表
  42. ALTER TABLE `friendship`.`platform_detail`
  43. ADD COLUMN `club_id` bigint(20) NULL COMMENT '公会id' AFTER `create_time`,
  44. ADD COLUMN `club_sugar` double(10, 2) NULL COMMENT '公会分成' AFTER `club_id`;
  45. -- 公会账户
  46. ALTER TABLE `friendship`.`club_account`
  47. MODIFY COLUMN `income_total` double(10, 4) NULL DEFAULT NULL COMMENT '总收益(单位元)' AFTER `club_id`,
  48. MODIFY COLUMN `with_draw_total` double(10, 4) NULL DEFAULT NULL COMMENT '总体现(单位元)' AFTER `income_total`,
  49. MODIFY COLUMN `balance` double(10, 4) NULL DEFAULT NULL COMMENT '余额(单位元)' AFTER `with_draw_total`;
  50. ALTER TABLE `friendship`.`club_account`
  51. ADD COLUMN `service_total_amount` double(10, 4) NULL COMMENT '服务总收益' AFTER `rate`,
  52. ADD COLUMN `consume_total_amount` double(10, 4) NULL COMMENT '消费总收益' AFTER `service_total_amount`;
  53. -- 公会账户详情
  54. ALTER TABLE `friendship`.`club_account_detail`
  55. MODIFY COLUMN `before_balance` double(20, 4) NULL DEFAULT 0.00 COMMENT '交易前余额' AFTER `trade_beans`,
  56. MODIFY COLUMN `trade_money` double(10, 4) NULL DEFAULT 0.00 COMMENT '交易金额' AFTER `before_balance`,
  57. MODIFY COLUMN `after_balance` double(20, 4) NULL DEFAULT 0.00 COMMENT '交易后的余额' AFTER `trade_money`;
  58. -- 公会
  59. ALTER TABLE `friendship`.`club`
  60. ADD COLUMN `new_logo` varchar(255) NULL COMMENT '修改的公会logo' AFTER `code`,
  61. ADD COLUMN `new_club_des` varchar(140) NULL COMMENT '修改的公会描述' AFTER `new_logo`,
  62. ADD COLUMN `new_wechat_name` varchar(32) NULL COMMENT '修改的公会微信号' AFTER `new_club_des`,
  63. ADD COLUMN `new_club_name` varchar(32) NULL COMMENT '修改的公会名称' AFTER `new_wechat_name`,
  64. ADD COLUMN `edit_verify_status` tinyint(2) NULL COMMENT '公会修改审核状态' AFTER `new_club_name`;
  65. ALTER TABLE `friendship`.`club`
  66. ADD COLUMN `remark` varchar(64) NULL COMMENT '拒绝理由' AFTER `edit_verify_status`;
  67. ALTER TABLE `friendship`.`club`
  68. MODIFY COLUMN `edit_verify_status` tinyint(2) NULL DEFAULT 0 COMMENT '公会修改审核状态' AFTER `new_club_name`;
  69. ALTER TABLE `friendship`.`club`
  70. ADD UNIQUE INDEX `idx_userId`(`user_id`) USING BTREE COMMENT '用户id唯一';
  71. -- 平台
  72. ALTER TABLE `friendship`.`platform_detail`
  73. MODIFY COLUMN `user_id` bigint(20) NULL DEFAULT NULL COMMENT '收到打赏的用户id,可能为空' AFTER `id`,
  74. ADD COLUMN `from_user_id` bigint(20) NULL COMMENT '消费的用户id' AFTER `club_sugar`;
  75. --2020/08/26 17:31
  76. ALTER TABLE `friendship`.`dynamic_comment`
  77. ADD COLUMN `read_status` tinyint(2) NULL DEFAULT 0 COMMENT '已读状态' AFTER `status`;
  78. -- 2020/08/27 9:57
  79. ALTER TABLE `friendship`.`dynamic_comment_like_detail`
  80. ADD COLUMN `read_status` tinyint(2) NULL DEFAULT 0 COMMENT '已读状态' AFTER `create_time`;
  81. -- 公会账户
  82. ALTER TABLE `friendship`.`club_account`
  83. MODIFY COLUMN `income_total` double(10, 4) NULL DEFAULT 0 COMMENT '总收益(单位元)' AFTER `club_id`,
  84. MODIFY COLUMN `with_draw_total` double(10, 4) NULL DEFAULT 0 COMMENT '总体现(单位元)' AFTER `income_total`,
  85. MODIFY COLUMN `balance` double(10, 4) NULL DEFAULT 0 COMMENT '余额(单位元)' AFTER `with_draw_total`,
  86. MODIFY COLUMN `service_total_amount` double(10, 4) NULL DEFAULT 0 COMMENT '服务总收益' AFTER `rate`,
  87. MODIFY COLUMN `consume_total_amount` double(10, 4) NULL DEFAULT 0 COMMENT '消费总收益' AFTER `service_total_amount`;
  88. -- 2020/08/30 14:30
  89. ALTER TABLE `friendship`.`user_account_with_draw_detail`
  90. ADD COLUMN `open_id` bigint(20) NULL COMMENT 'openId' AFTER `user_card_id`;
  91. -- 2020/09/01 11:35
  92. ALTER TABLE `friendship`.`user`
  93. ADD COLUMN `transformation_state` tinyint(2) null COMMENT '来源于渠道的转化状态' AFTER `game_authenticate`;
  94. ALTER TABLE `friendship`.`user`
  95. ADD COLUMN `logout_time` timestamp(0) NULL COMMENT '注销时间' AFTER `transformation_state`;
  96. ALTER TABLE `friendship`.`user`
  97. ADD UNIQUE INDEX `idx_wxid`(`wx_id`(32)) USING BTREE;
  98. ALTER TABLE `friendship`.`user_device`
  99. ADD COLUMN `active_channel` tinyint(2) null COMMENT '激活转化的广告渠道' AFTER `is_ad_activation`;
  100. -- 2020/09/02 16:25
  101. ALTER TABLE `friendship`.`user_account_with_draw_detail`
  102. ADD COLUMN `club_id` bigint(20) NULL COMMENT '提现的工会id' AFTER `user_card_id`;
  103. -- 2020/09/03 11:52
  104. ALTER TABLE `friendship`.`user_account_with_draw_detail`
  105. ADD COLUMN `wx_partner_trade_no` varchar(32) NULL COMMENT '微信商户订单号' AFTER `open_id`,
  106. ADD COLUMN `wx_payment_no` varchar(64) NULL COMMENT '微信微信付款单号' AFTER `wx_partner_trade_no`;
  107. -- 2020/09/03 19:59
  108. ALTER TABLE `friendship`.`user_wechat_info`
  109. MODIFY COLUMN `open_id` varchar(32) NULL COMMENT '微信openId' AFTER `user_id`;
  110. ALTER TABLE `friendship`.`user_wechat_info`
  111. ADD UNIQUE INDEX `idx-userId`(`user_id`) USING BTREE COMMENT '用户id唯一';
  112. ALTER TABLE `friendship`.`user_account_with_draw_detail`
  113. MODIFY COLUMN `open_id` varchar(32) NULL COMMENT '微信openId' AFTER `user_card_id`;
  114. -- 公会账户
  115. ALTER TABLE `friendship`.`club_account`
  116. MODIFY COLUMN `income_total` double(10, 3) NULL DEFAULT 0.0000 COMMENT '总收益(单位元)' AFTER `club_id`,
  117. MODIFY COLUMN `with_draw_total` double(10, 3) NULL DEFAULT 0.0000 COMMENT '总体现(单位元)' AFTER `income_total`,
  118. MODIFY COLUMN `balance` double(10, 3) NULL DEFAULT 0.0000 COMMENT '余额(单位元)' AFTER `with_draw_total`,
  119. MODIFY COLUMN `service_total_amount` double(10, 3) NULL DEFAULT 0.0000 COMMENT '服务总收益' AFTER `rate`,
  120. MODIFY COLUMN `consume_total_amount` double(10, 3) NULL DEFAULT 0.0000 COMMENT '消费总收益' AFTER `service_total_amount`;