Open the database with a higher version number.
This wil trigger the onupgradeneeded event. Once this is handle the onsuccess will return ths IDB connection in the latest version.
var dbrequest = indexedDB.open("name", version);
dbrequest.onupgradeneeded = function (){
// Upgrade db code
}
dbrequest.onsuccess = function(){
// db opened in the provided version.
}
If you just want to open a connection to the latest version, you can call the open method without providing a version.
var dbrequest = indexedDB.open("name");
dbrequest.onsuccess = function(){
// db opened in the latest version.
}