/*Table structure for table `t_operation_message` */
DROP TABLE IF EXISTS `t_operation_message`;
CREATE TABLE `t_operation_message` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`topic` varchar(255) NOT NULL COMMENT '消息主题',
`retry_count` int(11) DEFAULT '0' COMMENT '重试次数',
`detail` json DEFAULT NULL COMMENT '消息数据',
`message_status` int(11) NOT NULL COMMENT '状态',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_topic_status` (`topic`,`message_status`)
) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COMMENT='操作消息表';
/*Table structure for table `t_process_lock` */
DROP TABLE IF EXISTS `t_process_lock`;
CREATE TABLE `t_process_lock` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`lock_name` varchar(150) NOT NULL COMMENT '锁名称',
`address` varchar(40) DEFAULT NULL COMMENT '地址',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`ver` bigint(20) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_lock_name` (`lock_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COMMENT='处理锁';
CREATE TABLE `t_user` (
`pkId` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`id` VARCHAR(20) NOT NULL COMMENT 'ID',
`avatar` VARCHAR(200) DEFAULT NULL COMMENT '头像',
`email` VARCHAR(100) DEFAULT NULL COMMENT '邮箱',
`last_login_date` DATETIME DEFAULT NULL,
`last_login_ip` VARCHAR(255) DEFAULT NULL,
`last_login_location` VARCHAR(255) DEFAULT NULL,
`login_fail_times` INT(11) DEFAULT NULL,
`nickname` VARCHAR(50) DEFAULT NULL,
`password` VARCHAR(100) NOT NULL,
`mobile` VARCHAR(100) DEFAULT NULL,
`user_status` TINYINT(2) DEFAULT NULL,
`username` VARCHAR(100) NOT NULL,
`gender` VARCHAR(10) DEFAULT NULL,
`create_time` DATETIME NOT NULL,
`update_time` DATETIME NOT NULL,
PRIMARY KEY (`pkId`),
UNIQUE KEY `uni_user_username` (`username`),
UNIQUE KEY `uni_user_email` (`email`),
UNIQUE KEY `uni_user_id` (`id`),
UNIQUE KEY `uni_user_mobile` (`mobile`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息';
CREATE TABLE `t_message` (
`pk_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`id` VARCHAR(20) NOT NULL COMMENT '消息ID',
`session_id` VARCHAR(20) NOT NULL COMMENT '会话ID',
`to_user_id` VARCHAR(20) NOT NULL COMMENT '接受用户',
`user_id` VARCHAR(20) NOT NULL COMMENT '用户ID',
`user_type` VARCHAR(20) NOT NULL COMMENT '用户类型',
`content` JSON DEFAULT NULL COMMENT '消息数据',
`message_type` INT(20) NOT NULL COMMENT '消息类型',
`ref_biz_id` VARCHAR(60) DEFAULT NULL COMMENT '引用ID',
`ref_biz_type` INT(10) DEFAULT NULL COMMENT '引用类型',
`biz_code` VARCHAR(20) NOT NULL COMMENT '业务码',
`message_status` TINYINT NOT NULL COMMENT '消息状态',
`create_time` DATETIME NOT NULL COMMENT '创建时间',
`update_time` DATETIME NOT NULL COMMENT '更新时间',
`ver` BIGINT(20) DEFAULT 0 COMMENT '版本',
PRIMARY KEY (`pk_id`),
KEY `index_to_session_user_id_biz` (`session_id`,`biz_code`),
KEY `index_session_ref` (`session_id`,`biz_code`,`ref_biz_type`,`ref_biz_id`),
UNIQUE KEY `index_message_id` (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COMMENT='消息表';