Added version to dexie base class

This commit is contained in:
Dennis Postma 2025-01-22 20:34:16 +01:00
parent 78f1c6e6a0
commit 41005735f9

View File

@ -4,10 +4,10 @@ export class BaseStorage<T extends { id: string }> {
protected dexie: Dexie protected dexie: Dexie
protected tableName: string protected tableName: string
constructor(tableName: string, schema: string) { constructor(tableName: string, schema: string, version = 1) {
this.tableName = tableName this.tableName = tableName
this.dexie = new Dexie(tableName) this.dexie = new Dexie(tableName)
this.dexie.version(1).stores({ this.dexie.version(version).stores({
[tableName]: schema [tableName]: schema
}) })
} }