-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path321.sql
More file actions
199 lines (188 loc) · 6.94 KB
/
Copy path321.sql
File metadata and controls
199 lines (188 loc) · 6.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
MySQL Data Transfer
Source Host: localhost
Source Database: test
Target Host: localhost
Target Database: test
Date: 2019/1/3 21:35:17
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`no` varchar(255) NOT NULL,
`pwd` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`tel` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `no` (`no`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_blog
-- ----------------------------
DROP TABLE IF EXISTS `t_blog`;
CREATE TABLE `t_blog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`infos` varchar(255) DEFAULT NULL,
`time` varchar(255) DEFAULT NULL,
`itid` bigint(20) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`zhaiyao` varchar(255) DEFAULT NULL,
`picurls` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `title` (`title`),
KEY `t_blog_ibfk_1` (`itid`),
CONSTRAINT `t_blog_ibfk_1` FOREIGN KEY (`itid`) REFERENCES `t_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_items
-- ----------------------------
DROP TABLE IF EXISTS `t_items`;
CREATE TABLE `t_items` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`urls` varchar(255) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`price` float DEFAULT NULL,
`infos` longtext,
`brand` varchar(255) DEFAULT NULL,
`no` varchar(255) DEFAULT NULL,
`sells` int(11) DEFAULT NULL,
`category` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `no` (`no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_message
-- ----------------------------
DROP TABLE IF EXISTS `t_message`;
CREATE TABLE `t_message` (
`id` varchar(255) NOT NULL,
`infos` varchar(255) DEFAULT NULL,
`state` varchar(255) DEFAULT NULL,
`reply` varchar(255) DEFAULT NULL,
`uid` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `t_message_ibfk_1` (`uid`),
CONSTRAINT `t_message_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `t_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_notice
-- ----------------------------
DROP TABLE IF EXISTS `t_notice`;
CREATE TABLE `t_notice` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`infos` varchar(255) DEFAULT NULL,
`time` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_order
-- ----------------------------
DROP TABLE IF EXISTS `t_order`;
CREATE TABLE `t_order` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`uid` bigint(20) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`itid` bigint(20) DEFAULT NULL,
`price` float DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`state` varchar(255) DEFAULT NULL,
`postno` varchar(255) DEFAULT NULL,
`tel` varchar(255) DEFAULT NULL,
`paytype` varchar(255) DEFAULT NULL,
`infos` varchar(255) DEFAULT NULL,
`urls` varchar(255) DEFAULT NULL,
`province` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `t_order_ibfk_1` (`uid`),
KEY `t_order_ibfk_2` (`itid`),
CONSTRAINT `t_order_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `t_user` (`id`),
CONSTRAINT `t_order_ibfk_2` FOREIGN KEY (`itid`) REFERENCES `t_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_pingjia
-- ----------------------------
DROP TABLE IF EXISTS `t_pingjia`;
CREATE TABLE `t_pingjia` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '用户名\r\n',
`infos` varchar(255) DEFAULT NULL,
`addtime` varchar(255) DEFAULT NULL,
`uid` bigint(20) DEFAULT NULL,
`itid` bigint(20) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`grade` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `t_pingjia_ibfk_1` (`uid`),
KEY `t_pingjia_ibfk_2` (`itid`),
CONSTRAINT `t_pingjia_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `t_user` (`id`),
CONSTRAINT `t_pingjia_ibfk_2` FOREIGN KEY (`itid`) REFERENCES `t_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_shopcar
-- ----------------------------
DROP TABLE IF EXISTS `t_shopcar`;
CREATE TABLE `t_shopcar` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`urls` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`num` int(11) DEFAULT NULL,
`price` float DEFAULT NULL,
`uid` bigint(20) DEFAULT NULL,
`itid` bigint(20) DEFAULT NULL,
`state` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `shopcar_ibfk_1` (`uid`),
KEY `shopcar_ibfk_2` (`itid`),
CONSTRAINT `shopcar_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `t_user` (`id`),
CONSTRAINT `shopcar_ibfk_2` FOREIGN KEY (`itid`) REFERENCES `t_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`no` varchar(255) NOT NULL,
`pwd` varchar(255) DEFAULT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) DEFAULT NULL,
`tel` varchar(255) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`birth` varchar(255) DEFAULT NULL,
`role` varchar(255) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `no` (`no`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for t_wish
-- ----------------------------
DROP TABLE IF EXISTS `t_wish`;
CREATE TABLE `t_wish` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`urls` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`price` float DEFAULT NULL,
`uid` bigint(20) DEFAULT NULL,
`itid` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `wish_ibfk_1` (`uid`),
KEY `wish_ibfk_2` (`itid`),
CONSTRAINT `wish_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `t_user` (`id`),
CONSTRAINT `wish_ibfk_2` FOREIGN KEY (`itid`) REFERENCES `t_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `t_admin` VALUES ('1', 'admin1', '123', '李勇', 'liyong@126.com', '1222222'), ('2', 'admin2', '1234', '王芳', 'wangfang@qq.com', '13333333333');
INSERT INTO `t_notice` VALUES ('2', '天冷请注意保暖', '<i>注意保暖~</i>', '2018-12-13 04:12:29');
INSERT INTO `t_user` VALUES ('1', 'user3', '123', '张杰', '4908@126.com', '489465', '45', '1988-6-5', 'user1', '123'), ('2', 'user1', '123', '李明', '156@qq.com', '156489163', '20', '1998-6-18', 'user1', '123'), ('3', 'user2', '123', '王盘', '156@qq.com', '1648946', '26', '1999-12-5', 'user1', '123');