|
@@ -148,42 +148,9 @@ int sqlExecute2(char *query) {
|
|
|
*/
|
|
|
|
|
|
int sqlSetup() {
|
|
|
- sqlExecute("CREATE TABLE IF NOT EXISTS nodes "
|
|
|
- "(id INTEGER PRIMARY KEY ASC AUTOINCREMENT, "
|
|
|
- "guid INTEGER UNIQUE, "
|
|
|
- "term INTEGER, "
|
|
|
- "terminal NUMERIC, "
|
|
|
- "devclass INTEGER, "
|
|
|
- "devtype INTEGER, "
|
|
|
- "hw INTEGER, "
|
|
|
- "fwmajor INTEGER, "
|
|
|
- "fwminor INTEGER, "
|
|
|
- "lastseen INTEGER, "
|
|
|
- "tableversion INTEGER, "
|
|
|
- "clockspeed INTEGER, "
|
|
|
- "voltage NUMERIC);");
|
|
|
sqlExecute("CREATE TABLE IF NOT EXISTS config "
|
|
|
"(id INTEGER PRIMARY KEY, "
|
|
|
"value NUMERIC);");
|
|
|
- sqlExecute("CREATE TABLE IF NOT EXISTS monitorlog "
|
|
|
- "(id INTEGER PRIMARY KEY ASC AUTOINCREMENT, "
|
|
|
- "time NUMERIC, "
|
|
|
- "node INTEGER, "
|
|
|
- "type INTEGER, "
|
|
|
- "value NUMERIC, "
|
|
|
- "weight INTEGER);");
|
|
|
- sqlExecute("CREATE TABLE IF NOT EXISTS counters "
|
|
|
- "(id INTEGER PRIMARY KEY ASC, "
|
|
|
- "por INTEGER, "
|
|
|
- "wdr INTEGER, "
|
|
|
- "bodr INTEGER, "
|
|
|
- "er INTEGER, "
|
|
|
- "asc INTEGER, "
|
|
|
- "uptime INTEGER, "
|
|
|
- "rxerr INTEGER, "
|
|
|
- "txerr INTEGER, "
|
|
|
- "rx INTEGER, "
|
|
|
- "tx INTEGER);");
|
|
|
return 0;
|
|
|
}
|
|
|
|