-- 身份证号,姓名,地址长度修改
-- http://confluence.quantgroup.cn/pages/viewpage.action?pageId=61679207
alter table xyqb_user.user_detail
    modify column id_no varchar(128) default '' comment '身份证号',
    modify column name varchar(128) default '' comment '真实姓名';
alter table xyqb_user.user_authorized
    modify column id_no varchar(128) default '' comment '身份证号',
    modify column name varchar(128) default '' comment '用户姓名';
alter table xyqb_user.user_modify_phone_no
    modify column id_card varchar(128) default '' comment '身份证号',
    modify column name varchar(128) default '' comment '注册人真实姓名';
alter table xyqb_user.contact
    modify column name varchar(128) default '' comment '用户姓名';
alter table xyqb_user.user_spouse
    modify column spouse_name varchar(128) default '' comment '配偶姓名';
alter table xyqb_user.address
    modify column province varchar(128) default '' comment '省',
    modify column city varchar(128) default '' comment '市',
    modify column district varchar(128) default '' comment '区',
    modify column address varchar(255) default '' comment '详细地址';


# 销户需求
-- http://confluence.quantgroup.cn/pages/viewpage.action?pageId=61677003
CREATE TABLE `user_deregister_record`
(
    `id`              bigint(20)                             NOT NULL AUTO_INCREMENT COMMENT '主键ID',
    `user_id`         bigint(20)                             NOT NULL COMMENT '用户ID',
    `phone_no`        varchar(255)                           NOT NULL COMMENT '手机号MD5值',
    `password`        varchar(128) DEFAULT ''                NULL COMMENT '密码',
    `registered_from` bigint(20)   DEFAULT 0                 null COMMENT '渠道ID',
    `uuid`            varchar(64)  DEFAULT '' COMMENT 'uuid',
    `deregister_time` DATETIME                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '销户时间',
    `created_at`      timestamp    default CURRENT_TIMESTAMP not null comment '创建时间',
    `updated_at`      timestamp    default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
    PRIMARY KEY (`id`),
    KEY `idx_user_id` (`user_id`) USING BTREE,
    KEY `idx_delete_time` (`deregister_time`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8 COMMENT ='销户记录表';
