-
Notifications
You must be signed in to change notification settings - Fork 0
/
Create Tables.txt
60 lines (53 loc) · 1.93 KB
/
Create Tables.txt
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
--wp_WindIOT_Battery
CREATE TABLE `wp_WindIOT_Battery` (
`Location` char(10) NOT NULL,
`SampleTime` int(11) unsigned NOT NULL,
`StateOfCharge` float DEFAULT NULL,
`TIMESTAMP` datetime DEFAULT current_timestamp(),
`ResetsCntr` int(11) DEFAULT NULL,
`AngleFail` int(11) DEFAULT NULL,
`CompassFail` int(11) DEFAULT NULL,
`TempAirFail` int(11) DEFAULT NULL,
`TempWaterFail` int(11) DEFAULT NULL,
`TempBoxFail` int(11) DEFAULT NULL,
PRIMARY KEY (`Location`,`SampleTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
--wp_WindIOT_RawJSON
CREATE TABLE `wp_WindIOT_RawJSON` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`TimeStamp` datetime NOT NULL,
`JSON` varchar(500) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=235 DEFAULT CHARSET=latin1
-- wp_WindIOT_Temperatures
CREATE TABLE `wp_WindIOT_Temperatures` (
`Location` char(10) NOT NULL,
`SampleTime` int(11) unsigned NOT NULL,
`Air` float DEFAULT NULL,
`Water` float DEFAULT NULL,
`ControlBox` float DEFAULT NULL,
`TIMESTAMP` datetime DEFAULT current_timestamp(),
PRIMARY KEY (`Location`,`SampleTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
--wp_WindIOT_Wind
CREATE TABLE `wp_WindIOT_Wind` (
`Location` char(10) NOT NULL,
`SampleTime` int(11) unsigned NOT NULL,
`Speed` float DEFAULT NULL,
`GUST` float DEFAULT NULL,
`Direction` smallint(3) DEFAULT NULL,
`TIMESTAMP` datetime DEFAULT current_timestamp(),
PRIMARY KEY (`Location`,`SampleTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
-- Update for adding pressure sensor to estimate waves.
ALTER TABLE `wp_WindIOT_Battery` ADD `PressureFail` int(11) DEFAULT NULL;
CREATE TABLE `wp_WindIOT_PressureWave` (
`Location` char(10) NOT NULL,
`SampleTime` int(11) unsigned NOT NULL,
`AbsPressPa` float DEFAULT NULL,
`SigWaveHtFt` float DEFAULT NULL,
`BiggestWaveFt` float DEFAULT NULL,
`CountWave` smallint(3) DEFAULT NULL,
`TIMESTAMP` datetime DEFAULT current_timestamp(),
PRIMARY KEY (`Location`,`SampleTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8