From f7221b23280e4e6056fd57127c75072301f66553 Mon Sep 17 00:00:00 2001 From: shuzheng <469741414@qq.com> Date: Wed, 5 Oct 2016 00:32:47 +0800 Subject: [PATCH] add database sql --- cms/cms-dao/src/main/resources/zheng.sql | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cms/cms-dao/src/main/resources/zheng.sql diff --git a/cms/cms-dao/src/main/resources/zheng.sql b/cms/cms-dao/src/main/resources/zheng.sql new file mode 100644 index 00000000..77bfb13d --- /dev/null +++ b/cms/cms-dao/src/main/resources/zheng.sql @@ -0,0 +1,44 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50621 +Source Host : localhost:3306 +Source Database : zheng + +Target Server Type : MYSQL +Target Server Version : 50621 +File Encoding : 65001 + +Date: 2016-10-05 00:30:08 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for book +-- ---------------------------- +DROP TABLE IF EXISTS `book`; +CREATE TABLE `book` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userid` int(10) unsigned NOT NULL, + `name` varchar(45) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_book_1` (`userid`), + CONSTRAINT `book_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='用户书籍表'; + +-- ---------------------------- +-- Table structure for user +-- ---------------------------- +DROP TABLE IF EXISTS `user`; +CREATE TABLE `user` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(32) DEFAULT NULL, + `password` varchar(32) DEFAULT NULL, + `nickname` varchar(32) DEFAULT NULL, + `sex` int(11) DEFAULT NULL COMMENT '0未知,1男,2女', + `ctime` bigint(20) DEFAULT NULL, + `content` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='用户表';