博客项目搭建一

1、数据库的设计

设计数据库的依据

1、需求分析文档
2、原型图
3、要适当的和其他同事(需求分析人员,项目经理)

文章表

create table tn_article(
id int unsigned primary key auto_increment comment '文章id',
title varchar(64) not null default '' comment '文章标题',
content text not null comment '文章内容',
user_id int unsigned not null default 1 comment '用户编号',
create_ad int unsigned not null default 0 comment '发布时间',
summary varchar(256) not null default '' comment '文章简介',
category_id int unsigned not null default 1 comment '分类id',
cover varchar(256) not null default '' comment '封面图片',
state enum('publish','save') not null comment '状态',
is_delelte tinyint unsigned not null default 0 comment '是否删除',
tags varchar(256) not null default '' comment '标签'
)engine = myisam charset=utf8;

分类表


用户表

标签表

decs tn_article;

查看全部表内容

更改表明

alter table tn_blog rename to tn_article;
原文地址:https://www.cnblogs.com/qianjilou/p/15576916.html