lin
This commit is contained in:
parent
181e8c995d
commit
90204d78b6
|
@ -47,13 +47,20 @@ model Term {
|
|||
plan Plan? @relation(fields: [planId], references: [id])
|
||||
planId String?
|
||||
plans Plan[] @relation("plan_term")
|
||||
subject Subject? @relation(fields: [subjectId], references: [id], name: "subject_term")
|
||||
subjectId String?
|
||||
trainPlans TrainPlan[] @relation("TrainPlanTerm")
|
||||
majorId String? @map("major_id")
|
||||
major Outline? @relation("major_term", fields: [majorId], references: [id])
|
||||
identityId String? @map("identity_id")
|
||||
identity Outline? @relation("identity_term", fields: [identityId], references: [id])
|
||||
subjectId String? @map("subject_id")
|
||||
subject Outline? @relation("subject_term", fields: [subjectId], references: [id])
|
||||
courses Course[] @relation("course_term")
|
||||
|
||||
@@index([name]) // 对name字段建立索引,以加快基于name的查找速度
|
||||
@@index([parentId]) // 对parentId字段建立索引,以加快基于parentId的查找速度
|
||||
@@map("term")
|
||||
|
||||
|
||||
}
|
||||
|
||||
model TermAncestry {
|
||||
|
@ -166,6 +173,9 @@ model Department {
|
|||
domainStaffs Staff[] @relation("DomainStaff")
|
||||
deptStaffs Staff[] @relation("DeptStaff")
|
||||
terms Term[] @relation("department_term")
|
||||
progress Json? @map("progress") //单位训练进度表
|
||||
score Json? @map("score") //单位成绩评定表
|
||||
|
||||
|
||||
// watchedPost Post[] @relation("post_watch_dept")
|
||||
hasChildren Boolean? @default(false) @map("has_children")
|
||||
|
@ -193,6 +203,9 @@ model Staff {
|
|||
subjects Subject[] @relation("staff_subject")
|
||||
domainId String? @map("domain_id")
|
||||
deptId String? @map("dept_id")
|
||||
outlines Outline[] @relation("staff_outline")
|
||||
alreadyTime Json? @map("already_time") //个人训练进度表
|
||||
score Json? @map("score") //个人成绩评定表
|
||||
|
||||
domain Department? @relation("DomainStaff", fields: [domainId], references: [id])
|
||||
department Department? @relation("DeptStaff", fields: [deptId], references: [id])
|
||||
|
@ -251,25 +264,67 @@ model TrainPlan {
|
|||
terms Term[] @relation("TrainPlanTerm")
|
||||
day DateTime? @map("day") // 日期
|
||||
dayType String? @map("day_type") // 早中晚
|
||||
major String? @map("major") // 专业
|
||||
role String? @map("role") // 身份
|
||||
subject String? @map("subject") //科目
|
||||
course String? @map("course") // 课目
|
||||
outlines Outline[] @relation("train_plan_outline")
|
||||
trainTime Float? @map("train_time") // 培训时长
|
||||
content String? @map("content") // 内容
|
||||
meta Json? @map("meta") // 其他信息
|
||||
|
||||
@@index([day])
|
||||
@@index([major])
|
||||
@@index([subject])
|
||||
@@index([course])
|
||||
@@map("train_plan")
|
||||
}
|
||||
|
||||
model Outline {
|
||||
id String @id @default(cuid())
|
||||
|
||||
major Term[] @relation("major_term") //专业
|
||||
identity Term[] @relation("identity_term") //身份
|
||||
subject Term[] @relation("subject_term") //科目
|
||||
courses Course[] @relation("course") //课目
|
||||
daytime Float? @map("day_time") //昼间时长
|
||||
nighttime Float? @map("night_time") //夜间时长
|
||||
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @map("updated_at")
|
||||
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
|
||||
|
||||
staffs Staff[] @relation("staff_outline")
|
||||
trainplans TrainPlan[] @relation("train_plan_outline")
|
||||
}
|
||||
|
||||
model Course {
|
||||
id String @id @default(cuid())
|
||||
|
||||
outlineId String? @map("course_id")
|
||||
outline Outline? @relation("course", fields: [outlineId], references: [id])
|
||||
terms Term[] @relation("course_term")
|
||||
daytime Float? @map("day_time") //昼间时长
|
||||
nighttime Float? @map("night_time") //夜间时长
|
||||
score String? @map("score") //成绩标准
|
||||
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @map("updated_at")
|
||||
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
|
||||
|
||||
@@map("course")
|
||||
@@index([score])
|
||||
}
|
||||
|
||||
model Sport{
|
||||
id String @id @default(cuid())
|
||||
|
||||
type String? @map("type") // 基础、站斗、实用
|
||||
name String? @map("name") // 名称
|
||||
standard Json? @map("standard") // 标准
|
||||
|
||||
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @map("updated_at")
|
||||
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
|
||||
}
|
||||
|
||||
model Subject {
|
||||
id String @id @default(cuid())
|
||||
name String @map("name")
|
||||
terms Term[] @relation("subject_term")
|
||||
parentId String? @map("parent_id")
|
||||
parent Subject? @relation("SubjectChildren", fields: [parentId], references: [id]) // 父级帖子,关联 Post 模型
|
||||
children Subject[] @relation("SubjectChildren") // 子级帖子列表,关联 Post 模型
|
||||
|
|
Loading…
Reference in New Issue