-
Notifications
You must be signed in to change notification settings - Fork 29
/
MySQL_CreateTables.sql
37 lines (34 loc) · 1.02 KB
/
MySQL_CreateTables.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
CREATE TABLE `Data` (
`Timestamp` datetime NOT NULL,
`Name` varchar(64) COLLATE ascii_bin NOT NULL,
`ID` INT UNSIGNED NOT NULL,
`Angle` double NOT NULL,
`Temperature` double NOT NULL,
`Battery` double NOT NULL,
`ResetFlag` boolean,
`Gravity` double NOT NULL DEFAULT 0,
`UserToken` varchar(64) COLLATE ascii_bin,
`Interval` int,
`RSSI` int,
`Recipe` varchar(64),
PRIMARY KEY (`Timestamp`, `Name`, `ID`)
)
ENGINE=InnoDB DEFAULT CHARSET=ascii
COLLATE=ascii_bin COMMENT='iSpindle Data';
CREATE TABLE `Calibration` (
`ID` INT UNSIGNED NOT NULL,
`const1` double NOT NULL,
`const2` double NOT NULL,
`const3` double NOT NULL,
PRIMARY KEY (`ID`)
)
ENGINE=InnoDB DEFAULT CHARSET=ascii
COLLATE=ascii_bin COMMENT='iSpindle Calibration Data';
CREATE TABLE `Config` (
`ID` int NOT NULL,
`Interval` int NOT NULL,
`Token` varchar(64) NOT NULL,
`Polynomial` varchar(64) NOT NULL,
`Sent` boolean NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin COMMENT='iSpindle Config Data';