Commit 392b98a8 authored by Christopher Fullarton's avatar Christopher Fullarton

Fixes db migration

parent 808bb8b9
......@@ -11,18 +11,25 @@ export class AppDb extends Dexie {
constructor(dbName: DbName) {
super(dbName);
this.version(1).stores({
[DbTable.Config]: 'type',
[DbTable.Quiz]: 'name',
}).upgrade(async trans => {
return trans.db.delete();
});
this.version(0.1).stores({
[DbTable.Config]: '++id,&id',
[DbTable.Quiz]: '++id,&id',
});
this.version(0.2)
.stores({
[DbTable.Config]: null,
[DbTable.Quiz]: null,
}).upgrade(trans => {
trans.idbtrans.db.deleteObjectStore(DbTable.Quiz);
trans.idbtrans.db.deleteObjectStore(DbTable.Config);
});
this.version(1).stores({
[DbTable.Config]: 'type',
[DbTable.Quiz]: 'name',
});
this.Config.get(StorageKey.PrivateKey).then(privateKey => {
if (privateKey) {
sessionStorage.setItem(StorageKey.PrivateKey, privateKey.value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment