Dexie.on.versionchange
Syntax
db.on("versionchange", function (event) {});Description
NOTE
Sample
var db = new Dexie("MyDB");
db.on("versionchange", function(event) {
if (confirm ("Another page tries to upgrade the database to version " +
event.newVersion + ". Accept?")) {
// Refresh current webapp so that it starts working with newer DB schema.
window.location.reload();
} else {
// Will let user finish its work in this window and
// block the other window from upgrading.
return false;
}
});