Closed planeth44 closed 5 years ago
You probably need to use the transaction
parameter of openDB
. I suspect that you're not able to start new transactions while upgrading.
const db = await openDB(myDb, DB_VERSION, {
async upgrade(db, oldVersion, newVersion, transaction) {
const v1Db = db
if (oldVersion < 1) {
// create stores
}
if (oldVersion < 2) {
const store = transaction.objectStore(storeName)
store.createIndex('statusIdx', 'status', { unique: false });
}
}
})
Thanks @NotWoods I figured it out as well, after a few hours of letting my brain cool off :)
Hi,
I'm trying to add an index to one of the store, and this the error message I get.