Compare commits
3 Commits
30bd11e239
...
758678b729
| Author | SHA1 | Date |
|---|---|---|
|
|
758678b729 | |
|
|
bfc595d843 | |
|
|
3ad10be5ca |
0
apps/web/src/app/admin/assessmentstandard/assessment-standard-layout.tsx
Normal file → Executable file
0
apps/web/src/app/admin/assessmentstandard/assessment-standard-layout.tsx
Normal file → Executable file
0
apps/web/src/app/admin/assessmentstandard/assessment-standard-provider.tsx
Normal file → Executable file
0
apps/web/src/app/admin/assessmentstandard/assessment-standard-provider.tsx
Normal file → Executable file
0
apps/web/src/app/admin/assessmentstandard/standard-create-content.tsx
Normal file → Executable file
0
apps/web/src/app/admin/assessmentstandard/standard-create-content.tsx
Normal file → Executable file
0
apps/web/src/components/models/course/detail/CourseOperationBtns/CourseOperationBtns.tsx
Normal file → Executable file
0
apps/web/src/components/models/course/detail/CourseOperationBtns/CourseOperationBtns.tsx
Normal file → Executable file
0
apps/web/src/components/models/department/department-children-select.tsx
Normal file → Executable file
0
apps/web/src/components/models/department/department-children-select.tsx
Normal file → Executable file
0
apps/web/src/components/models/trainContent/train-content-tree-select.tsx
Normal file → Executable file
0
apps/web/src/components/models/trainContent/train-content-tree-select.tsx
Normal file → Executable file
|
|
@ -45,6 +45,10 @@ model Term {
|
|||
depts Department[] @relation("department_term")
|
||||
hasChildren Boolean? @default(false) @map("has_children")
|
||||
posts Post[] @relation("post_term")
|
||||
Plan Plan? @relation(fields: [planId], references: [id])
|
||||
planId String?
|
||||
Subject Subject? @relation(fields: [subjectId], references: [id])
|
||||
subjectId String?
|
||||
|
||||
@@index([name]) // 对name字段建立索引,以加快基于name的查找速度
|
||||
@@index([parentId]) // 对parentId字段建立索引,以加快基于parentId的查找速度
|
||||
|
|
@ -420,6 +424,9 @@ model Department {
|
|||
// watchedPost Post[] @relation("post_watch_dept")
|
||||
hasChildren Boolean? @default(false) @map("has_children")
|
||||
|
||||
planId String?
|
||||
Plan Plan? @relation(fields: [planId], references: [id])
|
||||
|
||||
@@index([parentId])
|
||||
@@index([isDomain])
|
||||
@@index([name])
|
||||
|
|
@ -465,6 +472,7 @@ model Staff {
|
|||
enrollments Enrollment[]
|
||||
teachedPosts PostInstructor[]
|
||||
ownedResources Resource[]
|
||||
Plan Plan[]
|
||||
|
||||
@@index([officerId])
|
||||
@@index([deptId])
|
||||
|
|
@ -529,3 +537,70 @@ model SportStandard {
|
|||
@@unique([projectId, gender, personType], name: "projectId_gender_personType")
|
||||
@@map("sport_standard")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
model Plan {
|
||||
id String @id @default(cuid())
|
||||
authorId String? @map("author_id")
|
||||
author Staff? @relation(fields: [authorId], references: [id]) // 帖子作者,关联 Staff 模型
|
||||
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
publishedAt DateTime? @map("published_at") // 发布时间
|
||||
updatedAt DateTime @map("updated_at")
|
||||
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
|
||||
|
||||
terms Term[] @relation("plan_term")
|
||||
month DateTime @map("month")
|
||||
week DateTime @map("week")
|
||||
checked Boolean @default(false) @map("checked")
|
||||
depts Department[] @relation("plan_dept")
|
||||
meta Json? @map("meta") // 计划表
|
||||
|
||||
@@map("plan")
|
||||
}
|
||||
|
||||
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 模型
|
||||
ancestors SubjectAncestry[] @relation("DescendantToAncestor")
|
||||
descendants SubjectAncestry[] @relation("AncestorToDescendant")
|
||||
|
||||
@@map("subject")
|
||||
}
|
||||
|
||||
model SubjectAncestry {
|
||||
id String @id @default(cuid())
|
||||
relDepth Int @map("rel_depth")
|
||||
ancestorId String? @map("ancestor_id")
|
||||
ancestor Subject? @relation("DescendantToAncestor", fields: [ancestorId], references: [id])
|
||||
descendantId String @map("descendant_id")
|
||||
descendant Subject @relation("AncestorToDescendant", fields: [descendantId], references: [id])
|
||||
|
||||
@@index([ancestorId])
|
||||
@@index([descendantId])
|
||||
@@index([ancestorId, descendantId])
|
||||
@@map("subject_ancestry")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue