I'm trying to upgrade a DB in an app. I use QtQuick.LocalStorage 2.0.
When I call db.changeVersion
it works, but db.version
doesn't change until app restarts.
db.changeVersion(db.version, "2", function(tx){...}); // Update database to version 2
console.log(db.version); //Should return "2", instead returns previous version of database
How can have the new db.version
without restart the app?
I resolved my problem writing this function, that permits to upgrade from any version of the DB to the last version without problems.