/*
 Navicat Premium Data Transfer

 Source Server         : mysql政务测试2.22.195.139
 Source Server Type    : MySQL
 Source Server Version : 50744
 Source Host           : 2.22.195.139:3306
 Source Schema         : lifeline

 Target Server Type    : MySQL
 Target Server Version : 50744
 File Encoding         : 65001

 Date: 30/07/2024 17:03:33
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for chat_log
-- ----------------------------
DROP TABLE IF EXISTS `chat_log`;
CREATE TABLE `chat_log`  (
  `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '聊天记录表id',
  `topic_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主题id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '消息发送时间',
  `status` tinyint(2) NULL DEFAULT NULL COMMENT '1为正常状态,其他为删除状态',
  `notes` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '回复意见',
  `user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发起人用户ID',
  `manager_bms` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '专家标识码',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天记录表id' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for chat_topic
-- ----------------------------
DROP TABLE IF EXISTS `chat_topic`;
CREATE TABLE `chat_topic`  (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '聊天主题id(单独聊天时id为:用户id_专家bms)',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主题名称',
  `user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发起人id',
  `created_at` timestamp NULL DEFAULT NULL,
  `status` tinyint(2) NULL DEFAULT NULL COMMENT '1为正常状态,其他为删除状态',
  `type` tinyint(2) NULL DEFAULT NULL COMMENT '0单独聊天,1群聊天',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天主题id' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for chat_persons
-- ----------------------------
DROP TABLE IF EXISTS `chat_persons`;
CREATE TABLE `chat_persons`  (
  `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '聊天主题对应人员表id',
  `user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户id',
  `manager_bms` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '专家bms(id)',
  `topic_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主题id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '聊天主题对应人员表id' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
