-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.sql
62 lines (45 loc) · 1.87 KB
/
create.sql
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
delimiter $$
CREATE DATABASE `exercise` /*!40100 DEFAULT CHARACTER SET utf8 */$$
delimiter $$
CREATE DATABASE `exercise` /*!40100 DEFAULT CHARACTER SET utf8 */$$
delimiter $$
CREATE TABLE `exercise_plan` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) DEFAULT NULL,
`title` varchar(128) DEFAULT NULL COMMENT '计划标题',
`content` varchar(1024) DEFAULT NULL COMMENT '计划内容',
`addtime` datetime DEFAULT NULL COMMENT '添加时间',
`status` int(11) DEFAULT NULL COMMENT '状态标记:0未完成,1已完成',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='健身计划表'$$
delimiter $$
CREATE TABLE `exercise_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) DEFAULT NULL COMMENT '用户id',
`type` varchar(45) DEFAULT NULL COMMENT '运动类型',
`count` double DEFAULT NULL COMMENT '运动数量',
`unit` varchar(45) DEFAULT NULL COMMENT '单位',
`totaltime` double DEFAULT NULL COMMENT '总运动时间',
`date` date DEFAULT NULL,
`comment` varchar(1024) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='运动记录表'$$
delimiter $$
CREATE TABLE `exercisetype` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`typename` varchar(45) DEFAULT NULL COMMENT '名称',
`unit` varchar(45) DEFAULT NULL COMMENT '单位',
PRIMARY KEY (`id`),
UNIQUE KEY `typename_UNIQUE` (`typename`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='健身类型表'$$
delimiter $$
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
`nicname` varchar(45) DEFAULT NULL,
`lastlogin` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `username_UNIQUE` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8$$