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