friendshipModifyddl.sql 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. -- 2020-05-19 user_address_book
  2. ALTER TABLE `friendship`.`user_address_book`
  3. ADD INDEX `idx_username_phone`(`user_id`, `phone`(11)) USING BTREE COMMENT '用户id和手机号建立索引';
  4. -- 2020-05-19
  5. CREATE TABLE `friendship`.`user_not_interested_info` (
  6. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  7. `user_id` bigint(20) NULL COMMENT '用户id',
  8. `target_id` bigint(20) NULL COMMENT '不感兴趣的目标id',
  9. `type` tinyint(2) NULL COMMENT '不敢兴趣的类型,现在只有形象卡和作品两种类型',
  10. PRIMARY KEY (`id`),
  11. UNIQUE INDEX `idx_userId_targetId_type`(`user_id`, `target_id`, `type`) USING BTREE COMMENT '用户id和targetId和type建立唯一索引'
  12. ) COMMENT = '用户不敢兴趣的详情表';
  13. ALTER TABLE `friendship`.`image_card_recommand`
  14. ADD COLUMN `logic_delete` tinyint(2) NULL DEFAULT 0 COMMENT '是否逻辑删除:0:不删除:1:删除' AFTER `video_cover_image`;
  15. -- 2020-05-22
  16. ALTER TABLE `friendship`.`user_image_card`
  17. ADD INDEX `idx_user_id`(`user_id`) USING BTREE COMMENT '用户id创建索引';
  18. ALTER TABLE `friendship`.`user_image_card`
  19. DROP INDEX `idx_user_id`,
  20. ADD INDEX `idx_user_id`(`user_id`, `id`, `type`, `is_fill`) USING BTREE COMMENT '用户id创建索引';
  21. ALTER TABLE `friendship`.`image_card_recommand`
  22. DROP INDEX `imagecardUserId`,
  23. ADD INDEX `imagecardUserId`(`image_card_id`, `user_id`) USING BTREE COMMENT '形象卡用户id索引';
  24. ALTER TABLE `friendship`.`image_card_recommand`
  25. DROP INDEX `imagecardUserId`,
  26. ADD UNIQUE INDEX `imagecardUserId`(`image_card_id`) USING BTREE COMMENT '形象卡用户id索引,索引名字不能改,在程序中指定了使用当前索引';