forked from crowdhackathon-smartcity/istdev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodejsproject.sql
More file actions
49 lines (43 loc) · 1.52 KB
/
nodejsproject.sql
File metadata and controls
49 lines (43 loc) · 1.52 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
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `machines`
-- ----------------------------
DROP TABLE IF EXISTS `machines`;
CREATE TABLE `machines` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`relationship_id` int(11) DEFAULT '0',
`base_power` int(11) DEFAULT '2',
`max_power` int(11) DEFAULT '10',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of machines
-- ----------------------------
INSERT INTO `machines` VALUES ('1', '1', '1', '2', '10');
-- ----------------------------
-- Table structure for `measurements`
-- ----------------------------
DROP TABLE IF EXISTS `measurements`;
CREATE TABLE `measurements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`machine_id` int(11) DEFAULT '1',
`value` decimal(11,1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=363 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`api_key` varchar(255) DEFAULT NULL,
PRIMARY KEY (`user_id`,`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', 'admin', 'yolo', '12345');