将用户模块分割成多表,做成冷热数据分离
/*用户登陆表*/
CREATE TABLE customer_login (
customer_id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '用户ID',
login_name VARCHAR(20) NOT NULL COMMENT '用户登录名',
password CHAR(32) NOT NULL COMMENT 'MD5加密后的密码',
user_status TINYINT NOT NULL DEFAULT 1 COMMENT '用户状态',
modified_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后的修改时间',
PRIMARY KEY pk_customerid ( customer_id )
) ENGINE = INNODB COMMENT = '用户登录表';
/*用户信息表*/
CREATE TABLE customer_inf (
customer_inf_id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT '主键自增ID',
customer_id INT UNSIGNED NOT NULL COMMENT 'customer_login表的自增ID',
customer_name VARCHAR ( 20 ) NOT NULL COMMENT '用户的真实姓名',
identity_card_type TINYINT NOT NULL DEFAULT 1 COMME