kiwiDiary-数据库设计
2020-05-20 本文已影响0人
hewolf
数据库采用经典的mysql模式
账号成员表
create table if not exists kiwi_member (
uid int(11) auto_increment, -- 用户id
nickname varchar(50) not null, -- 用户昵称
avatar varchar(100) not null, -- 用户头像
reg_date int(11) not null default 0, -- 注册时间
primary key(uid)
) auto_increment=10000; -- 账号从10000开始
日记记录表
create table if not exists kiwi_diary(
id int(11) auto_increment, -- 日记id
uid int(11) not null default 0, -- 用户id
name varchar(50) not null, -- 日记名称
ltime int(11) not null default 0, -- 日记记录时间
utime int(11) not null default 0, -- 日记更新时间
content text not null, -- 日志记录内容
primary key(id)
) auto_increment=10000; -- 记录内容开始从10000算