This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.sql
55 lines (52 loc) · 2.03 KB
/
example.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
CREATE TABLE IF NOT EXISTS `dmrshark-log` (
`repeaterid` int(11) NOT NULL,
`srcid` int(11) NOT NULL,
`timeslot` tinyint(4) NOT NULL,
`dstid` int(11) NOT NULL,
`calltype` tinyint(4) NOT NULL,
`startts` datetime NOT NULL,
`endts` datetime NOT NULL,
`currrssi` smallint(6) NOT NULL DEFAULT '0',
`avgrssi` smallint(6) NOT NULL DEFAULT '0',
`currrmsvol` tinyint(4) NOT NULL DEFAULT '127',
`avgrmsvol` tinyint(4) NOT NULL DEFAULT '127',
`datatype` enum('unknown','normal sms','motorola tms sms','gps position') NOT NULL,
`datadecoded` varchar(1500) NOT NULL,
PRIMARY KEY (`srcid`,`startts`,`repeaterid`,`timeslot`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `dmrshark-repeaters` (
`callsign` varchar(25) NOT NULL,
`id` int(10) unsigned NOT NULL,
`type` varchar(25) NOT NULL,
`fwversion` varchar(25) NOT NULL,
`dlfreq` int(10) unsigned NOT NULL,
`ulfreq` int(10) unsigned NOT NULL,
`psuvoltage` float NOT NULL,
`patemperature` float NOT NULL,
`vswr` float NOT NULL,
`txfwdpower` float NOT NULL,
`txrefpower` float NOT NULL,
`lastactive` datetime NOT NULL,
`lastactive` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `callsign` (`callsign`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `dmrshark-msg-queue` (
`index` int(10) unsigned NOT NULL AUTO_INCREMENT,
`srcid` int(11) NOT NULL,
`dstid` int(11) NOT NULL,
`state` enum('waiting','processing','success','failure') NOT NULL DEFAULT 'waiting',
`msg` varchar(250) NOT NULL,
`type` enum('all','normal','motorola') NOT NULL DEFAULT 'all',
`addedat` datetime NOT NULL,
PRIMARY KEY (`index`),
UNIQUE KEY `secondary` (`srcid`,`dstid`,`msg`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3;
CREATE TABLE IF NOT EXISTS `dmrshark-emails-out` (
`dstemail` varchar(50) NOT NULL,
`srcid` int(11) NOT NULL,
`state` enum('waiting','success') NOT NULL DEFAULT 'waiting',
`msg` varchar(250) NOT NULL,
`addedat` datetime NOT NULL,
PRIMARY KEY (`dstemail`,`srcid`,`addedat`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;