0.0.0.5
This commit is contained in:
@@ -13,10 +13,23 @@ export interface StoredImage {
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface ActivityLog {
|
||||
id: string
|
||||
action: "create" | "update" | "delete" | "import" | "export"
|
||||
entityType: "member" | "photo" | "story" | "settings"
|
||||
entityId?: string
|
||||
entityName?: string
|
||||
changes?: any
|
||||
timestamp: string
|
||||
userId?: string
|
||||
userName?: string
|
||||
}
|
||||
|
||||
export class FamilyTreeDB extends Dexie {
|
||||
members!: Table<FamilyMember>
|
||||
settings!: Table<GlobalSettings>
|
||||
images!: Table<StoredImage>
|
||||
activityLogs!: Table<ActivityLog>
|
||||
|
||||
constructor() {
|
||||
super("FamilyTreeDB")
|
||||
@@ -25,6 +38,12 @@ export class FamilyTreeDB extends Dexie {
|
||||
settings: "key", // Key-value store for rootId etc.
|
||||
images: "id", // Store images by ID
|
||||
})
|
||||
this.version(2).stores({
|
||||
members: "id, fullName, fatherId, motherId, [fatherId+motherId]", // Index for searching
|
||||
settings: "key", // Key-value store for rootId etc.
|
||||
images: "id", // Store images by ID
|
||||
activityLogs: "id, timestamp, action, entityType, entityId",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user