diff --git a/private/storage.cpp b/private/storage.cpp index 4cb9548a1..654b94ca8 100644 --- a/private/storage.cpp +++ b/private/storage.cpp @@ -59,6 +59,10 @@ void StorageJob::start() if (operationName() == "save") { QSqlQuery query(m_db); + query.prepare("delete from data where key = :id"); + query.bindValue(":id", params["key"].toString()); + query.exec(); + query.prepare("insert into data values(:id, :source, :datavalue, 'now')"); query.bindValue(":id", params["key"].toString()); query.bindValue(":source", params["source"].toString());