3.5 KiB
3.5 KiB
Data Model
SchoolOS uses Prisma with SQLite. IDs are portable strings and timestamps are
stored in UTC. The schema is the source of truth; this document is a domain
map, not a replacement for prisma/schema.prisma.
Organization And Identity
School,SchoolYear,SchoolDistrict: organizational boundaries.User: authenticated account, role, school membership, locale, and soft deletion state.ClassGroup,ClassGroupTeacher,Enrollment: teaching assignments and current/historical class membership.Student,ParentStudentLink,ParentContact,EmergencyContact: student profile and linked guardians. Access must always be evaluated through the active student, parent link, class assignment, and school scope.
Academic Record
Subject,CompetencyTemplate,CompetencyCategory,Competency, andMasteryLevelDefinitiondefine editable school competency frameworks.ClassCompetencyAssignmentlinks a framework to a class.LearningProgressEntryis the evidence record used by progress, mastery, and competence visualizations.Assessment,AssessmentCompetencyLink, andAssessmentResultcapture assessment creation, competency links, and student results.GradingScheme,GradingWeightRule, andComputedGradehold calculation rules and computed outcomes.Report,ReportCardTemplate, andReportSectionhold report-card drafts, templates, and sections.
Classroom Operations
AttendanceSessionandAttendanceRecord: attendance and absence status.LessonPlan,Homework, andHomeworkSubmission: instructional planning and student work.TimetableSlot,CalendarEvent,SchoolEvent, andEventRegistration: time-bound school activity.TeacherAbsence, substitute models, transport models, and library checkout models support daily school operations.
Student Support And Communication
TeacherNote,BehaviorCategory,BehaviorIncident, andBehaviorIntervention: staff-only support context.IllnessReport,CounselingAppointment,HealthRecord, andWellnessmodels contain sensitive information; they require strict role, student, and school checks.CommunicationRoom,CommunicationRoomMember,CommunicationMessage,ParentMessage,Announcement, andNotificationprovide communication and delivery records.
Student Work And Learning Hub
Notebook,NotebookPage,NotebookPageVersion, andDrawingstore digital student work and version history.Resource,SubjectCategory,SubjectContent,SubjectTopic,SubjectLesson, andLessonQuestionrepresent learning content.- Badge, reward, competition, portfolio, goal, and study-plan models support student-facing learning workflows.
Compliance And Audit
AuditLogrecords sensitive operational actions.DataExportRequest,DeletionFlag,DataRetentionPolicy,DpiaRecord,ComplianceConsultation, andSchoolComplianceStatussupport rights, retention, and governance workflows.Backupstores metadata for storage-backed backup files; backup files live belowBACKUP_PATHand must not be placed in the database.
Change Rules
- Additive schema changes require a Prisma migration and an updated seed path.
- Never rename or remove a stored field without a migration/backfill plan.
- New personal-data fields require a purpose, access policy, audit requirement, export behavior, erasure behavior, and retention category before release.
- New feature tables must include school scope where the data is school-owned.