There are already questions and answers like this
Add Index to Pre-Existing ObjectStore In IndexedDB Using Javascript
but I can't see how that code caters for incremental versions for BOTH the setVersion and onUpgradeNeeded methods. Something like the following pseudoCode..
if (oldVersion < 1)
createObjectStore
if (oldVersion < 2)
createNewIndex
etc etc etc...
I.e. I know how to get the oldVersion for the setVersion method (Check if db.serVersion exists and then query the value of db.version), but I don't know how to get the old version for the newer onUpgradeNeeded method.
It wasn't obvious from http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#request-api either :-(
THanx.