|
|
@@ -1,6 +1,6 @@
|
|
|
/*==============================================================*/
|
|
|
/* DBMS name: MySQL 5.0 */
|
|
|
-/* Created on: 2017/1/8 22:41:06 */
|
|
|
+/* Created on: 2017/1/11 14:35:11 */
|
|
|
/*==============================================================*/
|
|
|
|
|
|
|
|
|
@@ -10,6 +10,8 @@ drop table if exists cms_article_category;
|
|
|
|
|
|
drop table if exists cms_article_tag;
|
|
|
|
|
|
+drop table if exists cms_book;
|
|
|
+
|
|
|
drop table if exists cms_category;
|
|
|
|
|
|
drop table if exists cms_category_tag;
|
|
|
@@ -22,6 +24,8 @@ drop table if exists cms_setting;
|
|
|
|
|
|
drop table if exists cms_tag;
|
|
|
|
|
|
+drop table if exists cms_user;
|
|
|
+
|
|
|
drop table if exists pay_in_order;
|
|
|
|
|
|
drop table if exists pay_in_order_detail;
|
|
|
@@ -40,10 +44,6 @@ drop table if exists pay_vendor;
|
|
|
|
|
|
drop table if exists pay_vest;
|
|
|
|
|
|
-drop table if exists test_book;
|
|
|
-
|
|
|
-drop table if exists test_user;
|
|
|
-
|
|
|
drop table if exists upms_organization;
|
|
|
|
|
|
drop table if exists upms_permission;
|
|
|
@@ -121,6 +121,21 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章标签表';
|
|
|
|
|
|
alter table cms_article_tag comment '文章标签关联表';
|
|
|
|
|
|
+/*==============================================================*/
|
|
|
+/* Table: cms_book */
|
|
|
+/*==============================================================*/
|
|
|
+create table cms_book
|
|
|
+(
|
|
|
+ book_id int(10) unsigned not null auto_increment comment '编号',
|
|
|
+ user_id int(10) unsigned not null comment '用户编号',
|
|
|
+ name varchar(45) not null comment '书名',
|
|
|
+ primary key (book_id),
|
|
|
+ key FK_book_1 (user_id)
|
|
|
+)
|
|
|
+ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='用户书籍表';
|
|
|
+
|
|
|
+alter table cms_book comment '书';
|
|
|
+
|
|
|
/*==============================================================*/
|
|
|
/* Table: cms_category */
|
|
|
/*==============================================================*/
|
|
|
@@ -235,6 +250,24 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='标签表';
|
|
|
|
|
|
alter table cms_tag comment '标签表';
|
|
|
|
|
|
+/*==============================================================*/
|
|
|
+/* Table: cms_user */
|
|
|
+/*==============================================================*/
|
|
|
+create table cms_user
|
|
|
+(
|
|
|
+ user_id int(10) unsigned not null auto_increment comment '编号',
|
|
|
+ username varchar(32) default NULL comment '账号',
|
|
|
+ password varchar(32) default NULL comment '密码',
|
|
|
+ nickname varchar(32) default NULL comment '昵称',
|
|
|
+ sex int(11) default NULL comment '0未知,1男,2女',
|
|
|
+ ctime bigint(20) default NULL comment '创建时间',
|
|
|
+ content text comment '备注',
|
|
|
+ primary key (user_id)
|
|
|
+)
|
|
|
+ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='用户表';
|
|
|
+
|
|
|
+alter table cms_user comment '用户';
|
|
|
+
|
|
|
/*==============================================================*/
|
|
|
/* Table: pay_in_order */
|
|
|
/*==============================================================*/
|
|
|
@@ -367,39 +400,6 @@ create table pay_vest
|
|
|
|
|
|
alter table pay_vest comment '马甲支付参数配置表';
|
|
|
|
|
|
-/*==============================================================*/
|
|
|
-/* Table: test_book */
|
|
|
-/*==============================================================*/
|
|
|
-create table test_book
|
|
|
-(
|
|
|
- book_id int(10) unsigned not null auto_increment comment '编号',
|
|
|
- user_id int(10) unsigned not null comment '用户编号',
|
|
|
- name varchar(45) not null comment '书名',
|
|
|
- primary key (book_id),
|
|
|
- key FK_book_1 (user_id)
|
|
|
-)
|
|
|
-ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='用户书籍表';
|
|
|
-
|
|
|
-alter table test_book comment '书';
|
|
|
-
|
|
|
-/*==============================================================*/
|
|
|
-/* Table: test_user */
|
|
|
-/*==============================================================*/
|
|
|
-create table test_user
|
|
|
-(
|
|
|
- user_id int(10) unsigned not null auto_increment comment '编号',
|
|
|
- username varchar(32) default NULL comment '账号',
|
|
|
- password varchar(32) default NULL comment '密码',
|
|
|
- nickname varchar(32) default NULL comment '昵称',
|
|
|
- sex int(11) default NULL comment '0未知,1男,2女',
|
|
|
- ctime bigint(20) default NULL comment '创建时间',
|
|
|
- content text comment '备注',
|
|
|
- primary key (user_id)
|
|
|
-)
|
|
|
-ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='用户表';
|
|
|
-
|
|
|
-alter table test_user comment '用户';
|
|
|
-
|
|
|
/*==============================================================*/
|
|
|
/* Table: upms_organization */
|
|
|
/*==============================================================*/
|
|
|
@@ -537,6 +537,9 @@ alter table cms_article_tag add constraint FK_Reference_3 foreign key (article_i
|
|
|
alter table cms_article_tag add constraint FK_Reference_4 foreign key (tag_id)
|
|
|
references cms_tag (tag_id) on delete cascade on update cascade;
|
|
|
|
|
|
+alter table cms_book add constraint FK_Reference_9 foreign key (user_id)
|
|
|
+ references cms_user (user_id) on delete cascade on update cascade;
|
|
|
+
|
|
|
alter table cms_category add constraint FK_Reference_10 foreign key (pid)
|
|
|
references cms_category (category_id) on delete set null on update restrict;
|
|
|
|
|
|
@@ -582,9 +585,6 @@ alter table pay_type add constraint FK_Reference_12 foreign key (pay_vendor_id)
|
|
|
alter table pay_vest add constraint FK_Reference_14 foreign key (pay_type_id)
|
|
|
references pay_type (pay_type_id) on delete restrict on update restrict;
|
|
|
|
|
|
-alter table test_book add constraint FK_Reference_9 foreign key (user_id)
|
|
|
- references test_user (user_id) on delete cascade on update cascade;
|
|
|
-
|
|
|
alter table upms_organization add constraint FK_Reference_15 foreign key (system_id)
|
|
|
references upms_system (system_id) on delete restrict on update restrict;
|
|
|
|