代码拉取完成,页面将自动刷新
#及时通讯项目
#登录、注册、找回密码、发送好友申请、搜索好友、查看我的申请、
#通过/拒绝申请、好友列表、聊天(文本、图片、语音聊天、视频通话)
create database im_chat_2306;
#用户表
create table user(
id int primary key auto_increment comment '主键',
username varchar(20) unique not null comment '用户名',
password char(32) not null comment '密码',
nickname varchar(10) not null comment '昵称',
header text not null comment '头像',
email varchar(30) not null unique comment '邮箱',
pinyin varchar(50) not null comment '昵称的拼音',
create_time datetime not null comment '创建时间',
update_time datetime not null comment '最后修改时间',
status tinyint not null comment '状态',
del_flag tinyint not null comment '删除标识'
) comment '用户表';
#好友申请表
create table friend_request(
id int primary key auto_increment comment '好友申请id',
from_id int not null comment '申请人id',
to_id int not null comment '被申请人id',
beizhu varchar(10) comment '申请人对被申请人的备注',
info varchar(100) comment '验证消息',
create_time datetime not null comment '创建时间',
update_time datetime not null comment '最后修改时间',
status tinyint not null comment '状态 0-待处理 1-已通过 2-已拒绝',
del_flag tinyint not null comment '删除标识'
) comment '好友申请表';
#好友关系表
create table friend_relation(
id int primary key auto_increment comment '关系id',
uid int not null comment '用户id',
fid int not null comment '好友id',
beizhu varchar(10) comment '当前用户对好友的备注信息',
create_time datetime not null comment '创建时间',
update_time datetime not null comment '最后修改时间',
status tinyint not null comment '状态 0-普通好友 1-拉黑',
del_flag tinyint not null comment '删除标识',
#用户id 好友id 唯一性联合索引
unique index(uid, fid)
) comment '好友关系';
#历史消息表
create table msg_history(
id int primary key auto_increment comment '消息id',
uid int not null comment '发送者id',
fid int not null comment '接受者id',
msg text not null comment '消息的内容',
type tinyint not null comment '消息的类型 0-文本消息 1-图片消息 2-语音消息 3-视频通话',
create_time datetime not null comment '创建时间',
update_time datetime not null comment '最后修改时间',
status tinyint not null comment '状态 0-未接收 1-已接收',
del_flag tinyint not null comment '删除标识'
) comment '历史消息表';
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。