diff --git a/packages/common/prisma/schema.prisma b/packages/common/prisma/schema.prisma index fcac841..3599549 100755 --- a/packages/common/prisma/schema.prisma +++ b/packages/common/prisma/schema.prisma @@ -123,8 +123,6 @@ model AppConfig { @@map("app_config") } - - model Resource { id String @id @default(cuid()) @map("id") title String? @map("title") @@ -153,7 +151,6 @@ model Resource { @@map("resource") } - model Department { id String @id @default(cuid()) name String @@ -188,15 +185,15 @@ model Department { } 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") - age Int? @default(22) @map("age") - sex Boolean? @default(true) @map("sex") - absent Boolean? @default(false) @map("absent") + 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? @default(22) @map("age") + sex Boolean? @default(true) @map("sex") + absent Boolean? @default(false) @map("absent") trainSituations TrainSituation[] position Position? @relation("StaffPosition", fields: [positionId], references: [id]) positionId String? @map("position_id") @@ -235,8 +232,6 @@ model Staff { @@map("staff") } - - model Plan { id String @id @default(cuid()) authorId String? @map("author_id") @@ -248,8 +243,6 @@ model Plan { 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") // 计划表 @@ -257,6 +250,34 @@ model 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 { id String @id @default(cuid()) name String @map("name")