-
Notifications
You must be signed in to change notification settings - Fork 9
/
gitup
121 lines (92 loc) · 3.45 KB
/
gitup
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
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.9
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
--
-- Create schema gitup
--
CREATE DATABASE IF NOT EXISTS gitup;
USE gitup;
--
-- Definition of table `activity`
--
DROP TABLE IF EXISTS `activity`;
CREATE TABLE `activity` (
`activity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_sitting` tinyint(1) NOT NULL DEFAULT '0',
`last_sitting_duration` varchar(100) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`activity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `activity`
--
/*!40000 ALTER TABLE `activity` DISABLE KEYS */;
/*!40000 ALTER TABLE `activity` ENABLE KEYS */;
--
-- Definition of table `chairs`
--
DROP TABLE IF EXISTS `chairs`;
CREATE TABLE `chairs` (
`chair_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`chair_name` varchar(45) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`chair_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `chairs`
--
/*!40000 ALTER TABLE `chairs` DISABLE KEYS */;
/*!40000 ALTER TABLE `chairs` ENABLE KEYS */;
--
-- Definition of table `messages`
--
DROP TABLE IF EXISTS `messages`;
CREATE TABLE `messages` (
`msg_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`msg_body` varchar(100) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`msg_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `messages`
--
/*!40000 ALTER TABLE `messages` DISABLE KEYS */;
/*!40000 ALTER TABLE `messages` ENABLE KEYS */;
--
-- Definition of table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(45) CHARACTER SET latin1 NOT NULL,
`firstname` varchar(45) CHARACTER SET latin1 NOT NULL,
`lastname` varchar(45) CHARACTER SET latin1 NOT NULL,
`password` varchar(45) CHARACTER SET latin1 NOT NULL,
`chair_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` (`user_id`,`email`,`firstname`,`lastname`,`password`,`chair_id`) VALUES
(1,'[email protected]','Ken','King','password',1),
(2,'[email protected]','Jenny','Yuan','password',2),
(3,'[email protected]','Khoa','Nguyen','password',3),
(4,'test1%40test.com','testfname','testlname','password',4),
(5,'test2%40test.com','test2fname','test2lname','password',5);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;