if backlogdb then
if not file_exists(backlogdb) then
touch(backlogdb)
- backlog_con = assert(env:connect(backlogdb))
- backlog_con:execute("CREATE TABLE queue(time_stamp datetime,sensor_id varchar(16),sensor varchar(16),param varchar(16),value float)")
- else
- backlog_con = assert(env:connect(backlogdb))
- end
+ end
+ backlog_con = assert(env:connect(backlogdb))
+ backlog_con:execute("CREATE TABLE queue(time_stamp datetime,sensor_id varchar(16),sensor varchar(16),param varchar(16),value float)")
end
if logdb then
if not file_exists(logdb) then
touch(logdb)
- log_con = assert(env:connect(logdb))
- log_con:execute("CREATE TABLE log(time_stamp datetime,sensor_id varchar(16),sensor varchar(16),param varchar(16),value float)")
- log_con:execute("CREATE INDEX log_idx ON log(sensor_id,sensor,param,time_stamp)")
- else
- log_con = assert(env:connect(logdb))
- end
+ end
+ log_con = assert(env:connect(logdb))
+ log_con:execute("CREATE TABLE log(time_stamp datetime,sensor_id varchar(16),sensor varchar(16),param varchar(16),value float)")
+ log_con:execute("CREATE INDEX log_idx ON log(sensor_id,sensor,param,time_stamp)")
end
if mqtt_host then