This commit is contained in:
longdayi 2025-02-21 13:20:15 +08:00
parent 2f42048c5c
commit db43031fd4
1 changed files with 71 additions and 54 deletions

View File

@ -45,6 +45,7 @@ model Term {
depts Department[] @relation("department_term")
hasChildren Boolean? @default(false) @map("has_children")
posts Post[] @relation("post_term")
@@index([name]) // 对name字段建立索引以加快基于name的查找速度
@@index([parentId]) // 对parentId字段建立索引以加快基于parentId的查找速度
@@map("term")
@ -221,6 +222,7 @@ model Post {
watchableStaffs Staff[] @relation("post_watch_staff") // 可观看的员工列表,关联 Staff 模型
watchableDepts Department[] @relation("post_watch_dept") // 可观看的部门列表,关联 Department 模型
meta Json? // 封面url 视频url objectives具体的学习目标 rating评分Int
// 索引
@@index([type, domainId])
@@index([authorId, type])
@ -302,8 +304,6 @@ model Visit {
@@map("visit")
}
model Enrollment {
id String @id @default(cuid()) @map("id")
status String @map("status")
@ -404,3 +404,20 @@ model NodeEdge {
@@index([targetId])
@@map("node_edge")
}
model Animal {
id String @id @default(cuid())
name String
age Int
gender Boolean
personId String?
person Person? @relation(fields: [personId], references: [id])
}
model Person {
id String @id @default(cuid())
name String
age Int
gender Boolean
animals Animal[]
}