kimmoli / valuelogger

Simple application for Jolla to log and plot some values you need to track
MIT License
3 stars 6 forks source link

pairedtable -column not added to db in all cases #15

Closed kimmoli closed 9 years ago

kimmoli commented 9 years ago

When transitioning from older version, pairedtable -column not added to database when creating new parameter, before user has added pairing.

This causes parameter adding to fail.

[D] Logger::addParameterEntry:277 - Adding entry:  "test7"  - ""  color  QColor(ARGB 1, 1, 1, 1) 
[D] Logger::addParameterEntry:299 - addParameterEntry failed "test7"  :  QSqlError(-1, "Parameter count mismatch", "")
kimmoli commented 9 years ago

Tested by removing column from db:

CREATE TEMPORARY TABLE parambackup(parameter TEXT, description TEXT, visualize INTEGER, plotcolor TEXT, datatable TEXT PRIMARY KEY);
INSERT INTO parambackup SELECT parameter, description, visualize, plotcolor, datatable FROM parameters;
DROP TABLE parameters;
CREATE TABLE IF NOT EXISTS parameters (parameter TEXT, description TEXT, visualize INTEGER, plotcolor TEXT, datatable TEXT PRIMARY KEY);
INSERT INTO parameters SELECT parameter, description, visualize, plotcolor, datatable FROM parambackup;
DROP TABLE parambackup;

and then adding new parameter was succesfull:

[D] Logger::addParameterEntry:277 - Adding entry:  "Kissa"  -  ""  color  QColor(ARGB 1, 1, 1, 1)
[D] Logger::addParameterEntry:282 - column pairedtable added succesfully
[D] Logger::addParameterEntry:298 - parameter added:  "Kissa"