-- MySQL dump 10.13  Distrib 5.7.44, for Linux (x86_64)
--
-- Host: localhost    Database: sonic-pigeon
-- ------------------------------------------------------
-- Server version	5.7.44-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `t_im_ai_chat_feedback`
--

DROP TABLE IF EXISTS `t_im_ai_chat_feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_im_ai_chat_feedback` (
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `message_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '消息ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的ID',
  `content` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文本内容',
  `opt_type` tinyint(4) DEFAULT NULL COMMENT '操作类型（1 赞、2 踩）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `_uqe_t_im_ai_chat_feedback_message_id_user_id_ai_id` (`message_id`,`user_id`,`ai_id`),
  KEY `_idx_t_im_ai_chat_feedback_message_id` (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_message`
--

DROP TABLE IF EXISTS `t_message`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_message` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `send_user_id` bigint(20) DEFAULT NULL COMMENT '发送人ID',
  `user_id` bigint(20) NOT NULL COMMENT '用户ID（接收人）',
  `type` int(11) NOT NULL COMMENT '消息类型',
  `biz_id` varchar(100) DEFAULT NULL COMMENT '导致消息发送的业务ID',
  `status` tinyint(4) DEFAULT NULL COMMENT '消息状态（0未读、1已读）',
  `title` varchar(256) DEFAULT NULL COMMENT '消息标题',
  `content` varchar(1024) DEFAULT NULL COMMENT '消息内容',
  `extras` varchar(1024) DEFAULT NULL COMMENT '消息扩展内容',
  `replace_json` varchar(1024) DEFAULT NULL COMMENT '国际化翻译的替换数据',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '最后修改时间',
  `is_delete` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已删除',
  PRIMARY KEY (`id`),
  KEY `index_user_id` (`user_id`),
  KEY `index_biz_id` (`biz_id`),
  KEY `_idx_t_message_user_id_type` (`user_id`,`type`)
) ENGINE=InnoDB AUTO_INCREMENT=1184 DEFAULT CHARSET=utf8mb4 COMMENT='消息记录表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_message_stat`
--

DROP TABLE IF EXISTS `t_message_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_message_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户ID（接收人）',
  `un_read` int(11) unsigned DEFAULT '0' COMMENT '未读数量',
  `latest_content` varchar(2000) DEFAULT '0' COMMENT '最新未读消息内容',
  `latest_time` timestamp NULL DEFAULT NULL COMMENT '最新未读消息时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '最后修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `_idx_t_message_stat_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8mb4 COMMENT='消息统计';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-11-13  2:22:50
