-- 客户端签名 CREATE TABLE `director`.`t_app_sign` ( `id` bigint(10) NOT NULL AUTO_INCREMENT, `client_name` varchar(8) NULL COMMENT '客户端名称', `app_version` varchar(10) NULL COMMENT 'app版本号', `sign_key` varchar(64) NULL COMMENT '签名的key', PRIMARY KEY (`id`) ) COMMENT = '客户端加密密钥表'; -- 用户表 ALTER TABLE `director`.`t_user` CHANGE COLUMN `user_name` `nick_name` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称' AFTER `id`, CHANGE COLUMN `password` `head_img` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像' AFTER `nick_name`, MODIFY COLUMN `id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '用户id' FIRST, ADD COLUMN `wx_id` varchar(32) NULL COMMENT '微信id' AFTER `id`, ADD COLUMN `apple_id` varchar(64) NULL COMMENT '苹果id身份信息' AFTER `wx_id`, ADD COLUMN `phone` varchar(16) NULL COMMENT '手机号码' AFTER `head_img`, ADD COLUMN `create_time` timestamp(0) NULL COMMENT '创建时间' AFTER `phone`, ADD COLUMN `update_time` timestamp(0) NULL COMMENT '更新时间' AFTER `create_time`, ADD COLUMN `device_token` varchar(64) NULL COMMENT '设备号' AFTER `update_time`, ADD COLUMN `logic_delete` tinyint(2) NOT NULL DEFAULT 0 COMMENT '逻辑删除' AFTER `device_token`, ADD UNIQUE INDEX `idx_phone`(`phone`(16)) USING BTREE COMMENT '手机号码做唯一索引', ADD UNIQUE INDEX `idx_wx_id`(`wx_id`(32)) USING BTREE COMMENT '微信id做唯一索引', ADD UNIQUE INDEX `idx_apple_id`(`apple_id`(64)) USING BTREE COMMENT '苹果id做唯一索引', COMMENT = '用户表'; -- 用户信息表 CREATE TABLE `director`.`t_user_info` ( `id` bigint(10) NOT NULL COMMENT 'id', `user_id` bigint(10) NULL COMMENT '用户id', `gender` tinyint(2) NULL COMMENT '性别', PRIMARY KEY (`id`), UNIQUE INDEX `idx_userId`(`user_id`) USING BTREE COMMENT '用户id唯一索引' );