 DROP TABLE IF EXISTS web_visitor;
 
 CREATE TABLE web_visitor (
-  id            INT         NOT NULL AUTO_INCREMENT
+  id            INT         AUTO_INCREMENT
   COMMENT '主键',
-  create_time   TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP
+  create_time   TIMESTAMP   DEFAULT CURRENT_TIMESTAMP
   COMMENT '创建时间',
-  update_time   TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+  update_time   TIMESTAMP   DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
   COMMENT '更新时间',
-  visitor_name  VARCHAR(45) NOT NULL
+  visitor_name  VARCHAR(45)
   COMMENT '访客名',
-  password      VARCHAR(45) NOT NULL
+  password      VARCHAR(45)
   COMMENT '密码',
-  password_salt VARCHAR(45) NOT NULL
+  password_salt VARCHAR(45)
   COMMENT '加密密码',
-  avatar        VARCHAR(80) NOT NULL DEFAULT '/img/visitor.jpg'
+  avatar        VARCHAR(80) DEFAULT '/img/visitor.jpg'
   COMMENT '头像',
   PRIMARY KEY (id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='网络访客表';

DROP TABLE IF EXISTS friend_link;

CREATE TABLE friend_link (
  id          INT         NOT NULL AUTO_INCREMENT
  COMMENT '主键',
  create_time TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP
  COMMENT '创建时间',
  update_time TIMESTAMP   NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  COMMENT '更新时间',
  friend_name VARCHAR(45) NOT NULL
  COMMENT '朋友名',
  url         VARCHAR(64) NOT NULL DEFAULT '#'
  COMMENT '友情链接',
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='友情链接表';

DROP TABLE IF EXISTS admin;

CREATE TABLE admin (
  username      VARCHAR(45)
  COMMENT '用户名',
  password      VARCHAR(45)
  COMMENT '密码',
  introduction  VARCHAR(200) DEFAULT ''
  COMMENT '用户简介',
  email         VARCHAR(64)  DEFAULT '#',
  github        VARCHAR(64)  DEFAULT '#',
  resume_md     TEXT COMMENT '简历的md格式文本',
  nickname      VARCHAR(45)  COMMENT '昵称',
  avatar        VARCHAR(80)  DEFAULT '/img/avatar.jpg'
  COMMENT '头像',
  PRIMARY KEY (username)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员表';
