db repaired

This commit is contained in:
silas 2018-11-05 14:44:02 +01:00
parent 71bde38da4
commit c656da15b5

View File

@ -11,7 +11,7 @@ export class WordRotatorDb extends MyDb {
}
constructor() {
super("wordRotator", 4);
super("wordRotator", 5);
}
upgrade(db, oldVersion, newVersion, e) {
@ -30,8 +30,10 @@ export class WordRotatorDb extends MyDb {
levelObjectStore.createIndex("difficulty", "difficulty", {"unique": false});
}
if (Helper.isNull(oldVersion) || oldVersion < 3 && newVersion >= 4) {
let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"});
if (Helper.isNull(oldVersion) || oldVersion < 5 && newVersion >= 5) {
if (!e.target.transaction.objectStore(WordRotatorDb.OBJECT_STORE.LEVEL)){
let levelObjectStore = db.createObjectStore(WordRotatorDb.OBJECT_STORE.SYSTEM_VARS, {"keyPath": "name"});
}
}
};