This commit is contained in:
linfeng 2025-04-21 18:58:35 +08:00
parent 5954b95742
commit 2acc55e58d
1 changed files with 37 additions and 16 deletions

View File

@ -123,8 +123,6 @@ model AppConfig {
@@map("app_config") @@map("app_config")
} }
model Resource { model Resource {
id String @id @default(cuid()) @map("id") id String @id @default(cuid()) @map("id")
title String? @map("title") title String? @map("title")
@ -153,7 +151,6 @@ model Resource {
@@map("resource") @@map("resource")
} }
model Department { model Department {
id String @id @default(cuid()) id String @id @default(cuid())
name String name String
@ -188,15 +185,15 @@ model Department {
} }
model Staff { model Staff {
id String @id @default(cuid()) id String @id @default(cuid())
showname String? @map("showname") showname String? @map("showname")
username String @unique @map("username") username String @unique @map("username")
avatar String? @map("avatar") avatar String? @map("avatar")
password String? @map("password") password String? @map("password")
phoneNumber String? @unique @map("phone_number") phoneNumber String? @unique @map("phone_number")
age Int? @default(22) @map("age") age Int? @default(22) @map("age")
sex Boolean? @default(true) @map("sex") sex Boolean? @default(true) @map("sex")
absent Boolean? @default(false) @map("absent") absent Boolean? @default(false) @map("absent")
trainSituations TrainSituation[] trainSituations TrainSituation[]
position Position? @relation("StaffPosition", fields: [positionId], references: [id]) position Position? @relation("StaffPosition", fields: [positionId], references: [id])
positionId String? @map("position_id") positionId String? @map("position_id")
@ -235,8 +232,6 @@ model Staff {
@@map("staff") @@map("staff")
} }
model Plan { model Plan {
id String @id @default(cuid()) id String @id @default(cuid())
authorId String? @map("author_id") authorId String? @map("author_id")
@ -248,8 +243,6 @@ model Plan {
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空 deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
terms Term[] @relation("plan_term") terms Term[] @relation("plan_term")
month DateTime @map("month")
week DateTime @map("week")
checked Boolean @default(false) @map("checked") checked Boolean @default(false) @map("checked")
depts Department[] @relation("plan_dept") depts Department[] @relation("plan_dept")
meta Json? @map("meta") // 计划表 meta Json? @map("meta") // 计划表
@ -257,6 +250,34 @@ model Plan {
@@map("plan") @@map("plan")
} }
model TrainPlan {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @map("updated_at")
deletedAt DateTime? @map("deleted_at") // 删除时间,可为空
planId String @map("plan_id")
plan Plan @relation(fields: [planId], references: [id])
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") // 课目
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 Subject { model Subject {
id String @id @default(cuid()) id String @id @default(cuid())
name String @map("name") name String @map("name")