Add 8 files, update 14 files
This commit is contained in:
1 parent
669e029f45
commit
c84b080fb8
22 files changed
+732
-101
No files matched your search
@@ -0,0 +1,15 @@
|
||||
ALTER TABLE "communication_rooms"
|
||||
ADD COLUMN "audienceType" TEXT NOT NULL DEFAULT 'direct',
|
||||
ADD COLUMN "classGroupId" TEXT,
|
||||
ADD COLUMN "escalationEligibleAt" TIMESTAMP(3),
|
||||
ADD COLUMN "escalatedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "resolvedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "resolutionStatus" TEXT NOT NULL DEFAULT 'open';
|
||||
|
||||
ALTER TABLE "communication_rooms"
|
||||
ADD CONSTRAINT "communication_rooms_classGroupId_fkey"
|
||||
FOREIGN KEY ("classGroupId") REFERENCES "ClassGroup"("id")
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
CREATE INDEX "communication_rooms_classGroupId_idx" ON "communication_rooms"("classGroupId");
|
||||
CREATE INDEX "communication_rooms_escalationEligibleAt_idx" ON "communication_rooms"("escalationEligibleAt");
|
||||
@@ -0,0 +1,21 @@
|
||||
ALTER TABLE "illness_reports"
|
||||
ADD COLUMN "leaveType" TEXT NOT NULL DEFAULT 'illness',
|
||||
ADD COLUMN "teacherNotifiedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "adminApprovalStatus" TEXT NOT NULL DEFAULT 'pending',
|
||||
ADD COLUMN "adminApprovedBy" TEXT,
|
||||
ADD COLUMN "adminApprovedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "adminNotes" TEXT,
|
||||
ADD COLUMN "calendarEventId" TEXT;
|
||||
|
||||
ALTER TABLE "illness_reports"
|
||||
ADD CONSTRAINT "illness_reports_adminApprovedBy_fkey"
|
||||
FOREIGN KEY ("adminApprovedBy") REFERENCES "User"("id")
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE "illness_reports"
|
||||
ADD CONSTRAINT "illness_reports_calendarEventId_fkey"
|
||||
FOREIGN KEY ("calendarEventId") REFERENCES "CalendarEvent"("id")
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
CREATE UNIQUE INDEX "illness_reports_calendarEventId_key" ON "illness_reports"("calendarEventId");
|
||||
CREATE INDEX "illness_reports_adminApprovalStatus_idx" ON "illness_reports"("adminApprovalStatus");
|
||||
@@ -198,6 +198,7 @@ model User {
|
||||
chatMessages ChatMessage[]
|
||||
illnessReports IllnessReport[]
|
||||
illnessReportApprovals IllnessReport[] @relation("IllnessApprover")
|
||||
illnessReportAdminApprovals IllnessReport[] @relation("IllnessAdminApprover")
|
||||
communicationRoomMembers CommunicationRoomMember[]
|
||||
communicationMessages CommunicationMessage[]
|
||||
counselingAppointments CounselingAppointment[] @relation("Counselor")
|
||||
@@ -298,6 +299,7 @@ model ClassGroup {
|
||||
peerAssessmentSessions PeerAssessmentSession[] @relation("PeerAssessmentClassGroup")
|
||||
schoolEvents SchoolEvent[]
|
||||
aiTestGenerations AITestGeneration[]
|
||||
communicationRooms CommunicationRoom[]
|
||||
examPlans ExamPlan[]
|
||||
seatingCharts SeatingChart[]
|
||||
substitutionAssignments SubstitutionAssignment[]
|
||||
@@ -1154,6 +1156,7 @@ model CalendarEvent {
|
||||
parentEvent CalendarEvent? @relation("EventRecurrence", fields: [parentEventId], references: [id])
|
||||
childEvents CalendarEvent[] @relation("EventRecurrence")
|
||||
examPlan ExamPlan?
|
||||
illnessReport IllnessReport?
|
||||
|
||||
@@index([schoolId])
|
||||
@@index([teacherId])
|
||||
@@ -2489,8 +2492,14 @@ model CommunicationRoom {
|
||||
studentId String
|
||||
teacherId String
|
||||
roomType String @default("chat") // chat, voice, video
|
||||
audienceType String @default("direct") // direct, class_group, parent_group, staff
|
||||
classGroupId String?
|
||||
status String @default("requested") // requested, active, closed
|
||||
requestedBy String // student or teacher
|
||||
escalationEligibleAt DateTime?
|
||||
escalatedAt DateTime?
|
||||
resolvedAt DateTime?
|
||||
resolutionStatus String @default("open") // open, resolved, unresolved
|
||||
acceptedAt DateTime?
|
||||
closedAt DateTime?
|
||||
closeReason String?
|
||||
@@ -2500,6 +2509,7 @@ model CommunicationRoom {
|
||||
school School @relation(fields: [schoolId], references: [id])
|
||||
student User @relation("RoomStudent", fields: [studentId], references: [id])
|
||||
teacher User @relation("RoomTeacher", fields: [teacherId], references: [id])
|
||||
classGroup ClassGroup? @relation(fields: [classGroupId], references: [id])
|
||||
members CommunicationRoomMember[]
|
||||
messages CommunicationMessage[]
|
||||
chatMessages ChatMessage[]
|
||||
@@ -2508,6 +2518,8 @@ model CommunicationRoom {
|
||||
@@index([studentId])
|
||||
@@index([teacherId])
|
||||
@@index([status])
|
||||
@@index([classGroupId])
|
||||
@@index([escalationEligibleAt])
|
||||
@@map("communication_rooms")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user