v1.0.sql 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ALTER TABLE `privatedomain`.`user`
  2. ADD COLUMN `head_img` varchar(255) NULL COMMENT '头像' AFTER `open_id`,
  3. MODIFY COLUMN `nick_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '昵称' AFTER `open_id`,
  4. ADD COLUMN `gender` tinyint(2) NULL COMMENT '性别' AFTER `nick_name`,
  5. ADD COLUMN `master_id` bigint(20) NULL COMMENT '师傅' AFTER `phone`,
  6. ADD COLUMN `vip` tinyint(2) NULL DEFAULT 0 COMMENT 'vip' AFTER `master_id`,
  7. ADD COLUMN `vip_expiration_time` timestamp(0) NULL COMMENT 'vip过期时间' AFTER `vip`
  8. MODIFY COLUMN `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '手机号' AFTER `head_img`,
  9. ADD COLUMN `agency` tinyint(2) NULL COMMENT '代言资质' AFTER `vip_expiration_time`;
  10. ALTER TABLE `privatedomain`.`user`
  11. ADD COLUMN `expiration_vip_type` tinyint(2) NULL COMMENT '过期会员类型' AFTER `login_time`;
  12. ALTER TABLE `privatedomain`.`background_image`
  13. MODIFY COLUMN `status` tinyint(2) NULL DEFAULT NULL COMMENT '状态' AFTER `img_src`;
  14. ALTER TABLE `privatedomain`.`private_domain`
  15. MODIFY COLUMN `auto_change_qr` tinyint(2) NULL DEFAULT 0 COMMENT '自动更换二维码开关' AFTER `wechat_num`;
  16. INSERT INTO `privatedomain`.`system_config`(`name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES ('额外购买的私域价格', '79.0', NULL, '2021-01-08 10:08:30', NULL, 'EWGMSYJG');
  17. INSERT INTO `privatedomain`.`system_config`(`name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES ('会员可编辑的免费私域数量', '5', NULL, '2021-01-08 10:15:06', NULL, 'HYSYS');
  18. INSERT INTO `privatedomain`.`system_config`(`name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES ('体验会员可编辑的免费私域数', '1', NULL, '2021-01-08 10:16:00', NULL, 'TYHYSYS');
  19. ALTER TABLE `privatedomain`.`user`
  20. ADD COLUMN `update_time` timestamp(0) NULL COMMENT '更新时间' AFTER `expiration_vip_type`;
  21. ALTER TABLE `privatedomain`.`orders`
  22. ADD COLUMN `inviter_id` bigint(20) NULL COMMENT '开通vip时的邀请人' AFTER `user_id`;
  23. ALTER TABLE `privatedomain`.`user_account`
  24. ADD UNIQUE INDEX `user_id_index`(`user_id`) USING BTREE COMMENT '用户id唯一索引';
  25. ALTER TABLE `privatedomain`.`orders`
  26. ADD COLUMN `preferential_price` decimal(10, 0) NULL DEFAULT NULL COMMENT '邀请人优惠金额' AFTER `total_amount`;
  27. ALTER TABLE `privatedomain`.`pay_content`
  28. ADD COLUMN `immediately_reduce_price_amount` decimal(10, 2) NULL COMMENT '立减金额' AFTER `total_amount`,
  29. ADD COLUMN `name` varchar(64) NULL COMMENT '支付类型名' AFTER `immediately_reduce_price_amount`;
  30. INSERT INTO `privatedomain`.`pay_content`(`id`, `sn`, `parent_id`, `quantity`, `unit_price`, `total_amount`, `immediately_reduce_price_amount`, `name`, `remarks`, `status`) VALUES (100000, 'vip', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
  31. INSERT INTO `privatedomain`.`pay_content`(`id`, `sn`, `parent_id`, `quantity`, `unit_price`, `total_amount`, `immediately_reduce_price_amount`, `name`, `remarks`, `status`) VALUES (100001, NULL, 100000, 1, 39.00, 39, 0.00, 'VIP月卡', NULL, 0);
  32. INSERT INTO `privatedomain`.`pay_content`(`id`, `sn`, `parent_id`, `quantity`, `unit_price`, `total_amount`, `immediately_reduce_price_amount`, `name`, `remarks`, `status`) VALUES (100002, NULL, 100000, 12, 33.25, 399, 69.00, 'VIP年卡', NULL, 0);
  33. INSERT INTO `privatedomain`.`pay_content`(`id`, `sn`, `parent_id`, `quantity`, `unit_price`, `total_amount`, `immediately_reduce_price_amount`, `name`, `remarks`, `status`) VALUES (200000, 'extra_private_domain', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
  34. INSERT INTO `privatedomain`.`pay_content`(`id`, `sn`, `parent_id`, `quantity`, `unit_price`, `total_amount`, `immediately_reduce_price_amount`, `name`, `remarks`, `status`) VALUES (200001, NULL, 200000, 1, 79.00, 79, 0.00, NULL, NULL, 0);
  35. ALTER TABLE `privatedomain`.`pay_content`
  36. MODIFY COLUMN `total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '总价' AFTER `unit_price`;
  37. ALTER TABLE `privatedomain`.`orders`
  38. MODIFY COLUMN `refund_time` timestamp(0) NULL DEFAULT NULL COMMENT '退款时间' AFTER `content_id`;
  39. ALTER TABLE `privatedomain`.`orders`
  40. MODIFY COLUMN `total_amount` decimal(11, 2) NULL DEFAULT NULL COMMENT '订单金额' AFTER `subjects`;
  41. ALTER TABLE `privatedomain`.`orders`
  42. ADD COLUMN `contact` varchar(64) NULL COMMENT '联系方式' AFTER `content_id`;
  43. ALTER TABLE `privatedomain`.`user`
  44. ADD COLUMN `become_agency_time` timestamp(0) NULL COMMENT '成为代理时间' AFTER `update_time`;
  45. ALTER TABLE `privatedomain`.`user_qr_code`
  46. ADD COLUMN `create_time` timestamp(0) NULL COMMENT '创建时间' AFTER `auto_change`;
  47. ALTER TABLE `privatedomain`.`private_domain`
  48. ADD COLUMN `url_key` varchar(128) NULL DEFAULT NULL COMMENT '生成链接的key' AFTER `auto_change_qr`,
  49. ADD COLUMN `url_key_create_time` timestamp(0) NULL DEFAULT NULL COMMENT 'url_key生成时间' AFTER `url_key`;
  50. ALTER TABLE `privatedomain`.`private_domain`
  51. ADD COLUMN `qr_code_change_time` timestamp(0) NULL COMMENT '二维码更换时间' AFTER `update_time`;
  52. INSERT INTO `privatedomain`.`system_config`(`name`, `value`, `des`, `create_time`, `update_time`, `sn`) VALUES ('最低提现金额', '10', NULL, '2021-01-15 19:21:34', NULL, 'ZDTXJE');
  53. ALTER TABLE `privatedomain`.`user`
  54. ADD COLUMN `becom_disciple_time` timestamp(0) NULL COMMENT '成为徒弟时间' AFTER `become_agency_time`;
  55. INSERT INTO `privatedomain`.`admin_user`(`account`, `password`, `nameCn`, `nameEn`, `lockFlag`, `delFlag`, `genUid`, `createTime`) VALUES ('super', '$2a$10$EfA1I9IMzk9ecGBgT/ig9.vOPbtydB6erkn4117y0s8GI4.V70sHe', '超级管理员', 'superman', 0, 0, 0, now());
  56. ALTER TABLE `privatedomain`.`statistical`
  57. ADD COLUMN `update_time` timestamp(0) NULL COMMENT '更新时间' AFTER `yesterday_agency_num`;
  58. INSERT INTO `privatedomain`.`statistical`(`yesterday_register_num`, `yesterday_vip_num`, `yesterday_agency_num`, `update_time`) VALUES (0, 0, 0, '2021-01-20 17:47:57');
  59. ALTER TABLE `privatedomain`.`video_tutorial`
  60. ADD COLUMN `seq` int(3) NULL COMMENT '排序' AFTER `release_time`;
  61. INSERT INTO `privatedomain`.`official_assistant`(`nickName`, `headImg`) VALUES ('官方账号', 'https://privatedomain.oss-cn-shenzhen.aliyuncs.com/qrcodeAndBgPic/2021012539392526_80702b81e30d4a1485ca6444afa45ff7.jpg');
  62. ALTER TABLE `privatedomain`.`private_domain`
  63. ADD COLUMN `is_effective` tinyint(2) NULL DEFAULT 0 COMMENT '是否有效1有效,0无效' AFTER `qr_code_change_time`;
  64. -- 2021-02-25
  65. ALTER TABLE `privatedomain`.`user_qr_code`
  66. ADD COLUMN `domain_id` bigint(20) NULL COMMENT '所属私域站id' AFTER `create_time`;
  67. -- v1.1.0
  68. ALTER TABLE `privatedomain`.`department_employee`
  69. ADD COLUMN `is_leader_in_dept` int(10) NULL COMMENT '表示在所在的部门内是否为上级0-否;1-是' AFTER `department_id`;
  70. ALTER TABLE `privatedomain`.`department_employee`
  71. ADD COLUMN `order` int(10) NULL COMMENT '部门内的排序值,默认为0,数值越大排序越前面' AFTER `is_leader_in_dept`;
  72. ALTER TABLE `privatedomain`.`employees`
  73. DROP COLUMN `order`;
  74. ALTER TABLE `privatedomain`.`department_employee`
  75. ADD UNIQUE INDEX `department_employee_index`(`employee_userid`, `department_id`) COMMENT '部门id与员工用户id唯一索引';
  76. ALTER TABLE `privatedomain`.`department`
  77. CHANGE COLUMN `order` `order_no` int(20) NULL DEFAULT NULL COMMENT '在父部门中的次序值' AFTER `parentid`;
  78. ALTER TABLE `privatedomain`.`department_employee`
  79. CHANGE COLUMN `order` `order_no` int(10) NULL DEFAULT NULL COMMENT '部门内的排序值,默认为0,数值越大排序越前面' AFTER `is_leader_in_dept`;
  80. ALTER TABLE `privatedomain`.`promote_qr_code`
  81. CHANGE COLUMN `state_name` `channel_id` bigint(20) NULL DEFAULT NULL COMMENT '渠道标签id' AFTER `group_id`,
  82. MODIFY COLUMN `group_id` bigint(20) NULL DEFAULT NULL COMMENT '分组id' AFTER `name`;
  83. ALTER TABLE `privatedomain`.`promote_qr_code`
  84. ADD COLUMN `create_time` timestamp(0) NULL COMMENT '创建时间' AFTER `state_key`;
  85. ALTER TABLE `privatedomain`.`user`
  86. ADD COLUMN `unionid` varchar(64) NULL COMMENT '微信unionid' AFTER `open_id`;
  87. ALTER TABLE `privatedomain`.`clientele`
  88. ADD UNIQUE INDEX `unionid_index`(`unionid`) COMMENT 'unionid唯一索引';
  89. ALTER TABLE `privatedomain`.`clientele`
  90. MODIFY COLUMN `add_way` int(4) NULL DEFAULT NULL COMMENT '该成员添加此客户的来源,具体含义详见来源定义' AFTER `state`;
  91. ALTER TABLE `privatedomain`.`employees`
  92. MODIFY COLUMN `main_department` bigint(20) NULL DEFAULT NULL COMMENT '主部门' AFTER `open_userid`;
  93. ALTER TABLE `privatedomain`.`clientele`
  94. DROP INDEX `unionid_index`,
  95. ADD UNIQUE INDEX `unionid_follow_userid_index`(`unionid`, `follow_userid`) USING BTREE COMMENT 'unionid and follow_userid唯一索引';
  96. ALTER TABLE `privatedomain`.`promote_qr_code`
  97. DROP COLUMN `channel_id`;
  98. ALTER TABLE `privatedomain`.`promote_qr_code`
  99. ADD COLUMN `clientele_statistical` int(10) NOT NULL DEFAULT 0 COMMENT '客户统计' AFTER `name`,
  100. ADD COLUMN `loss_of_statistical` int(10) NOT NULL DEFAULT 0 COMMENT '流失客户统计' AFTER `clientele_statistical`;
  101. ALTER TABLE `privatedomain`.`promote_qrcode_and_employees`
  102. ADD COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT FIRST,
  103. DROP PRIMARY KEY,
  104. ADD PRIMARY KEY (`id`) USING BTREE;
  105. insert into tag(id,name,type,create_time) VALUES (10000000,'默认分组',1,now());
  106. ALTER TABLE `privatedomain`.`clientele`
  107. DROP INDEX `unionid_follow_userid_index`,
  108. ADD INDEX `unionid_index`(`unionid`) USING BTREE COMMENT 'unionid_index',
  109. ADD UNIQUE INDEX `external_userid_follow_userid_index`(`external_userid`, `follow_userid`) USING BTREE COMMENT 'follow_userid and follow_userid唯一索引';