This commit is contained in:
Florian Dold 2023-08-30 18:39:14 +02:00
parent 8fed5b4b73
commit 7895728308
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -257,7 +257,7 @@ export function openDatabase(
req.onsuccess = (e) => {
req.result.onversionchange = (evt: IDBVersionChangeEvent) => {
logger.info(
`handling live db version change from ${evt.oldVersion} to ${evt.newVersion}`,
`handling versionchange on ${databaseName} from ${evt.oldVersion} to ${evt.newVersion}`,
);
req.result.close();
onVersionChange();
@ -274,6 +274,9 @@ export function openDatabase(
if (!transaction) {
throw Error("no transaction handle available in upgrade handler");
}
logger.info(
`handling upgradeneeded event on ${databaseName} from ${e.oldVersion} to ${e.newVersion}`,
);
onUpgradeNeeded(db, e.oldVersion, newVersion, transaction);
};
});