This commit is contained in:
freedakgmail
2025-11-30 09:16:43 +08:00
parent b436ae0680
commit fd9c064749
227 changed files with 1251 additions and 912 deletions
+6
View File
@@ -22,6 +22,7 @@ model User {
avatar String?
isAdmin Boolean @default(false) // 是否为管理员
isActive Boolean @default(true) // 是否启用
hasSeenHelp Boolean @default(false) // 是否已查看使用帮助
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -133,9 +134,14 @@ model FamilyMember {
// 关系
tree FamilyTree @relation(fields: [treeId], references: [id], onDelete: Cascade)
// 索引优化
@@index([treeId])
@@index([fatherId])
@@index([motherId])
@@index([treeId, generation]) // 复合索引:按树和世代查询
@@index([treeId, createdAt]) // 复合索引:按树和创建时间查询
@@index([fullName]) // 姓名搜索索引
@@index([surname]) // 姓氏筛选索引
}
enum Gender {