From c91cfa81bc640cc3b40853317c2bcd10f947969c Mon Sep 17 00:00:00 2001 From: Rao <1227431568@qq.com> Date: Mon, 10 Mar 2025 20:31:05 +0800 Subject: [PATCH] rht --- packages/common/prisma/schema.prisma | 43 ++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/packages/common/prisma/schema.prisma b/packages/common/prisma/schema.prisma index ed02c77..fc3118e 100755 --- a/packages/common/prisma/schema.prisma +++ b/packages/common/prisma/schema.prisma @@ -68,12 +68,15 @@ model TermAncestry { } model Staff { - id String @id @default(cuid()) - showname String? @map("showname") - username String @unique @map("username") - avatar String? @map("avatar") - password String? @map("password") - phoneNumber String? @unique @map("phone_number") + id String @id @default(cuid()) + showname String? @map("showname") + username String @unique @map("username") + avatar String? @map("avatar") + password String? @map("password") + phoneNumber String? @unique @map("phone_number") + age Int? @map("age") + sex Boolean? @map("sex") + absent Boolean? @map("absent") domainId String? @map("domain_id") deptId String? @map("dept_id") @@ -101,6 +104,8 @@ model Staff { teachedPosts PostInstructor[] ownedResources Resource[] + traincontent TrainContent[] @relation("StaffTrainContent") + @@index([officerId]) @@index([deptId]) @@index([domainId]) @@ -418,3 +423,29 @@ model Person { gender Boolean animals Animal[] } + + + + +model TrainContent { + id String @id @default(cuid()) + title String @map("title") + score Float? @map("score") + mustTrainTime String @map("must_train_time") + alreadyTrainTime String @map("already_train_time") + + type String @map("type") + + parentId String? @map("parent_id") + parent TrainContent? @relation("ContentParent", fields: [parentId], references: [id]) // 指向自身 + children TrainContent[] @relation("ContentParent") // 指向自身 + + staff Staff[] @relation("StaffTrainContent") + + + deletedAt DateTime? @map("deleted_at") + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + + @@map("train_content") +} \ No newline at end of file