1 Star 0 Fork 13

Eternal/ws-chat

forked from bule/ws-chat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ws-chat.sql 6.04 KB
一键复制 编辑 原始数据 按行查看 历史
bule 提交于 2023-12-15 17:14 . 添加sql文件
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 80031
Source Host : localhost:3306
Source Schema : ws-chat
Target Server Type : MySQL
Target Server Version : 80031
File Encoding : 65001
Date: 15/12/2023 17:13:35
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for apply
-- ----------------------------
DROP TABLE IF EXISTS `apply`;
CREATE TABLE `apply` (
`id` int(0) NOT NULL AUTO_INCREMENT,
`send_id` int(0) NOT NULL COMMENT '用户id',
`receiver_id` int(0) NOT NULL COMMENT '发送用户id',
`is_group` int(0) NULL DEFAULT 2 COMMENT '是否是群申请',
`status` int(0) NULL DEFAULT 0 COMMENT '状态 1:同意 2:拒绝',
`create_time` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for friend
-- ----------------------------
DROP TABLE IF EXISTS `friend`;
CREATE TABLE `friend` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(0) NULL DEFAULT NULL COMMENT '用户id',
`friend_id` int(0) NULL DEFAULT NULL COMMENT '好友id',
`state` int(0) NULL DEFAULT 1 COMMENT '关系状态 1:正常 0:拉黑',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '好友表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for group_member
-- ----------------------------
DROP TABLE IF EXISTS `group_member`;
CREATE TABLE `group_member` (
`id` int(0) NOT NULL COMMENT '主键',
`group_id` int(0) NOT NULL COMMENT '群id',
`member_id` int(0) NULL DEFAULT NULL COMMENT '成员id',
`state` int(0) NULL DEFAULT NULL COMMENT '成员身份 0:普通 1:管理 2:群主',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '群成员' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for groups
-- ----------------------------
DROP TABLE IF EXISTS `groups`;
CREATE TABLE `groups` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '群名称',
`member_num` int(0) NULL DEFAULT NULL COMMENT '群人数',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '群头像',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '群' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for message
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`sender_id` int(0) NOT NULL COMMENT '发送用户id',
`receiver_id` int(0) NOT NULL COMMENT '接收用户id,群聊时即群id',
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NOT NULL COMMENT '内容',
`type` int(0) NOT NULL DEFAULT 0 COMMENT '消息类型(文本、图片、视频等)',
`status` int(0) NOT NULL DEFAULT 0 COMMENT '接收状态(已读、未读等)',
`create_time` datetime(0) NOT NULL COMMENT '发送时间',
`is_group` int(0) NULL DEFAULT NULL COMMENT '是否群聊 1:单聊 2:群聊',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 117 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for music
-- ----------------------------
DROP TABLE IF EXISTS `music`;
CREATE TABLE `music` (
`id` int(0) NOT NULL COMMENT '主键',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '音乐名',
`author` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '作者',
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT 'mp3地址',
`cover_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '封面图地址',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for session
-- ----------------------------
DROP TABLE IF EXISTS `session`;
CREATE TABLE `session` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(0) NOT NULL COMMENT '用户id',
`session_id` int(0) NOT NULL COMMENT '对方用户id 群会话时则是群id',
`type` int(0) NOT NULL COMMENT '会话类型 1 单聊 2群聊',
`last_message` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL COMMENT '最后消息',
`last_time` datetime(0) NULL DEFAULT NULL COMMENT '最后消息发送时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = '会话表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(0) NOT NULL COMMENT '主键',
`nickname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '用户昵称',
`login_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '登录用户名',
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '密码',
`state` int(0) NULL DEFAULT NULL COMMENT '在线状态',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NULL DEFAULT NULL COMMENT '用户头像',
`create_time` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_as_ci COMMENT = 'state' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eternalNO/ws-chat.git
git@gitee.com:eternalNO/ws-chat.git
eternalNO
ws-chat
ws-chat
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385