diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index 718db96..b480844 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -84,13 +84,13 @@ def run(typ,freq,data): logging.debug("Insert %s", typ) if typ == "FMS": - cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableFMS")+" (time,fms,status,direction,directionText,tsi,description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)",(data["fms"],data["status"],data["direction"],data["directionText"],data["tsi"],data["description"])) + cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableFMS")+" (time, fms, status, direction, directionText, tsi, description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)", (data["fms"], data["status"], data["direction"], data["directionText"], data["tsi"], data["description"])) elif typ == "ZVEI": - cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time,zvei,description) VALUES (NOW(),%s,%s)",(data["zvei"],data["description"])) + cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time, zvei, description) VALUES (NOW(),%s,%s)", (data["zvei"], data["description"])) elif typ == "POC": - cursor.execute("INSERT INTO "+globals.config.get("MySQL","tablePOC")+" (time,ric,funktion,funktionChar,msg,bitrate,description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)",(data["ric"],data["function"],data["functionChar"],data["msg"],data["bitrate"],data["description"])) + cursor.execute("INSERT INTO "+globals.config.get("MySQL","tablePOC")+" (time, ric, function, functionChar, msg, bitrate, description) VALUES (NOW(),%s,%s,%s,%s,%s,%s)", (data["ric"], data["function"], data["functionChar"], data["msg"], data["bitrate"], data["description"])) else: logging.warning("Invalid Typ: %s", typ) diff --git a/plugins/MySQL/boswatch.sql b/plugins/MySQL/boswatch.sql index cf91616..e7ebfb7 100644 --- a/plugins/MySQL/boswatch.sql +++ b/plugins/MySQL/boswatch.sql @@ -32,12 +32,12 @@ SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `bos_fms` ( `id` int(11) NOT NULL AUTO_INCREMENT, `time` datetime NOT NULL, - `fms` varchar(8) NOT NULL, - `status` varchar(1) NOT NULL, - `direction` varchar(1) NOT NULL, - `directionText` text(10) NOT NULL, + `fms` char(8) NOT NULL, + `status` char(1) NOT NULL, + `direction` char(1) NOT NULL, + `directionText` char(10) NOT NULL, `tsi` varchar(3) NOT NULL, - `description` text NOT NULL, + `description` text, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; @@ -50,12 +50,12 @@ CREATE TABLE IF NOT EXISTS `bos_fms` ( CREATE TABLE IF NOT EXISTS `bos_pocsag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `time` datetime NOT NULL, - `ric` varchar(7) NOT NULL DEFAULT '0', - `funktion` int(1) NOT NULL, - `funktionChar` text(1) NOT NULL, - `msg` text NOT NULL, - `bitrate` int(4) NOT NULL, - `description` text NOT NULL, + `ric` char(7) NOT NULL, + `function` int(1) NOT NULL, + `functionChar` char(1), + `bitrate` int(4), + `msg` text, + `description` text, KEY `ID` (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; @@ -68,11 +68,11 @@ CREATE TABLE IF NOT EXISTS `bos_pocsag` ( CREATE TABLE IF NOT EXISTS `bos_zvei` ( `id` int(11) NOT NULL AUTO_INCREMENT, `time` datetime NOT NULL, - `zvei` varchar(5) NOT NULL DEFAULT '0', - `description` text NOT NULL, + `zvei` char(5) NOT NULL, + `description` text, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; /*!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 COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; \ No newline at end of file