-- C端 相关表
-- -------------------------------------
-- Table structure for customer_user 用户表
-- --------------------------------------
DROP TABLE IF EXISTS `customer_user`;
CREATE TABLE `customer_user`
(
    `id`            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
    `identifier_no` varchar(32)  DEFAULT '' UNIQUE COMMENT '账号ID',
    `nickname`      varchar(50)  DEFAULT NULL UNIQUE COMMENT '昵称/会员名称',
    `password`      varchar(100)  DEFAULT '' COMMENT '密码',
    `phone_number`  char(11)     DEFAULT '' COMMENT '手机号（大陆）',
    `email`         varchar(100) DEFAULT '' COMMENT '电子邮箱',
    `gmt_create`    TIMESTAMP    DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `gmt_modified`  TIMESTAMP    DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARACTER SET utf8mb4
  COLLATE utf8mb4_bin COMMENT ='用户表';

DROP TABLE IF EXISTS `customer_operation_log`;
CREATE TABLE `customer_operation_log`
(
    `id`               bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
    `customer_user_id` BIGINT UNSIGNED DEFAULT 0 COMMENT '客户id',
    `module`           varchar(64)   default '' comment '业务模块(菜单)',
    `type`             varchar(64)   default '' comment '业务类型(新增、修改)',
    `ipaddr`           varchar(128)  default '' comment '登录IP地址',
    `content`          varchar(2048) DEFAULT '' COMMENT '操作内容',
    `login_location`   varchar(255)  default '' comment '登录地点',
    `gmt_create`       TIMESTAMP     DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `gmt_modified`     TIMESTAMP     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
    PRIMARY KEY (`id`),
    INDEX              idx_cui (`customer_user_id`)
) ENGINE = InnoDB
  DEFAULT CHARACTER SET utf8mb4
  COLLATE utf8mb4_bin COMMENT ='用户操作日志表';