This commit is contained in:
freedakgmail
2025-11-23 00:49:16 +08:00
parent c033e46782
commit 626d7dddde
184 changed files with 321926 additions and 2720 deletions
+19
View File
@@ -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",
})
}
}