Added version to dexie base class
This commit is contained in:
parent
78f1c6e6a0
commit
41005735f9
@ -4,10 +4,10 @@ export class BaseStorage<T extends { id: string }> {
|
||||
protected dexie: Dexie
|
||||
protected tableName: string
|
||||
|
||||
constructor(tableName: string, schema: string) {
|
||||
constructor(tableName: string, schema: string, version = 1) {
|
||||
this.tableName = tableName
|
||||
this.dexie = new Dexie(tableName)
|
||||
this.dexie.version(1).stores({
|
||||
this.dexie.version(version).stores({
|
||||
[tableName]: schema
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user