Доделываю перед сдачей
This commit is contained in:
parent
1175ccff74
commit
0ebbe91f4f
15 changed files with 906 additions and 15 deletions
|
|
@ -50,14 +50,15 @@ model study_item {
|
|||
}
|
||||
|
||||
model study_slot {
|
||||
id Int @id(map: "pk_study_slot") @default(autoincrement())
|
||||
study_item_id Int
|
||||
where String
|
||||
studentsGroup String
|
||||
position Int
|
||||
study_item study_item @relation(fields: [study_item_id], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "fk_study_slot_study_item")
|
||||
timetable timetable? @relation(fields: [timetableId], references: [id])
|
||||
timetableId Int?
|
||||
id Int @id(map: "pk_study_slot") @default(autoincrement())
|
||||
study_item_id Int
|
||||
where String
|
||||
studentsGroup String
|
||||
position Int
|
||||
study_item study_item @relation(fields: [study_item_id], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "fk_study_slot_study_item")
|
||||
timetable timetable? @relation(fields: [timetableId], references: [id])
|
||||
timetableId Int?
|
||||
user_lesson_attended user_lesson_attended[]
|
||||
}
|
||||
|
||||
model timetable {
|
||||
|
|
@ -78,11 +79,13 @@ model users {
|
|||
is_moderator Boolean @default(false)
|
||||
lore String? @db.Text()
|
||||
|
||||
timetable timetable[]
|
||||
user_session user_session[]
|
||||
chat_message chat_message[]
|
||||
user_in_chat user_in_chat[]
|
||||
attended event_attendance[]
|
||||
timetable timetable[]
|
||||
user_session user_session[]
|
||||
chat_message chat_message[]
|
||||
user_in_chat user_in_chat[]
|
||||
attended event_attendance[]
|
||||
user_lesson_attended user_lesson_attended[]
|
||||
documents documents[]
|
||||
}
|
||||
|
||||
model user_session {
|
||||
|
|
@ -122,3 +125,34 @@ model user_in_chat {
|
|||
chat chat @relation(fields: [chatId], references: [id], onDelete: Cascade)
|
||||
user users @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model user_lesson_attended {
|
||||
user users @relation(fields: [userId], references: [id])
|
||||
slot study_slot @relation(fields: [slotId], references: [id])
|
||||
day DateTime @default(now())
|
||||
|
||||
userId Int
|
||||
slotId Int
|
||||
|
||||
@@id([userId, slotId, day])
|
||||
}
|
||||
|
||||
enum DocumentStatus {
|
||||
STARTED
|
||||
IN_PROGRESS
|
||||
FINISHED
|
||||
}
|
||||
|
||||
model documents {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
status DocumentStatus @default(STARTED)
|
||||
comment String @default("")
|
||||
filename String?
|
||||
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
|
||||
user users @relation(fields: [usersId], references: [id])
|
||||
usersId Int
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue