Добавил работу с расписанием

This commit is contained in:
Artem VV 2023-05-19 21:15:27 +07:00
parent e9b8b44d1b
commit 35a20acce6
13 changed files with 939 additions and 25 deletions

View file

@ -22,34 +22,23 @@ model study_item {
}
model study_slot {
id Int @id(map: "pk_study_slot") @default(autoincrement())
study_item_id Int?
study_item study_item? @relation(fields: [study_item_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_study_slot_study_item")
timetable_timetable_slot_1Tostudy_slot timetable[] @relation("timetable_slot_1Tostudy_slot")
timetable_timetable_slot_2Tostudy_slot timetable[] @relation("timetable_slot_2Tostudy_slot")
timetable_timetable_slot_3Tostudy_slot timetable[] @relation("timetable_slot_3Tostudy_slot")
timetable_timetable_slot_4Tostudy_slot timetable[] @relation("timetable_slot_4Tostudy_slot")
timetable_timetable_slot_5Tostudy_slot timetable[] @relation("timetable_slot_5Tostudy_slot")
timetable_timetable_slot_6Tostudy_slot timetable[] @relation("timetable_slot_6Tostudy_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?
}
model timetable {
id Int @id(map: "pk_timetable") @default(autoincrement())
slot_1 Int?
slot_2 Int?
slot_3 Int?
slot_4 Int?
slot_5 Int?
slot_6 Int?
day Int @db.SmallInt
teacher Int
study_slot_timetable_slot_1Tostudy_slot study_slot? @relation("timetable_slot_1Tostudy_slot", fields: [slot_1], references: [id], map: "fk_timetable_study_slot_1")
study_slot_timetable_slot_2Tostudy_slot study_slot? @relation("timetable_slot_2Tostudy_slot", fields: [slot_2], references: [id], map: "fk_timetable_study_slot_2")
study_slot_timetable_slot_3Tostudy_slot study_slot? @relation("timetable_slot_3Tostudy_slot", fields: [slot_3], references: [id], map: "fk_timetable_study_slot_3")
study_slot_timetable_slot_4Tostudy_slot study_slot? @relation("timetable_slot_4Tostudy_slot", fields: [slot_4], references: [id], map: "fk_timetable_study_slot_4")
study_slot_timetable_slot_5Tostudy_slot study_slot? @relation("timetable_slot_5Tostudy_slot", fields: [slot_5], references: [id], map: "fk_timetable_study_slot_5")
study_slot_timetable_slot_6Tostudy_slot study_slot? @relation("timetable_slot_6Tostudy_slot", fields: [slot_6], references: [id], map: "fk_timetable_study_slot_6")
users users @relation(fields: [teacher], references: [id], onDelete: Cascade, map: "fk_timetable_users_teacher")
id Int @id(map: "pk_timetable") @default(autoincrement())
day Int @db.SmallInt
odd Boolean
slots study_slot[]
teacher users @relation(fields: [teacherId], references: [id])
teacherId Int
}
model users {