Database Dictionary

Entity Relationship Diagram

Announcement
🔑 id (text)
• title (text)
• body (text)
• segment (text)
• priority (text)
• status (text)
• publishAt (timestamp without time zone)
• validUntil (timestamp without time zone)
+ 3 more columns...
Answer
🔑 id (text)
• label (text)
• image (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• questionnaireId (text)
AttempTest
🔑 id (text)
• studentId (text)
• preTestId (text)
• midTestId (text)
• finalTestId (text)
• tryCount (integer)
• marks (double precision)
• isCompleted (boolean)
+ 3 more columns...
AttemptAnswer
🔑 id (text)
• attemptId (text)
• questionnaireId (text)
• selectedAnswerIds (ARRAY)
• isCorrect (boolean)
• marks (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CalendarEvent
🔑 id (text)
• title (text)
• description (text)
• type (USER-DEFINED)
• frequency (USER-DEFINED)
• daysOfWeek (ARRAY)
• timezone (text)
• startAt (timestamp without time zone)
+ 14 more columns...
CalendarEventAttachment
🔑 id (text)
• eventId (text)
• name (text)
• url (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CalendarEventExternalParticipant
🔑 id (text)
• eventId (text)
• email (text)
• name (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CalendarEventParticipant
🔑 id (text)
• eventId (text)
• userId (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CategoryRating
🔑 id (text)
• systemReviewId (text)
• category (text)
• label (text)
• rating (integer)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• categoryId (text)
Certificate
🔑 id (text)
• studentId (text)
• courseId (text)
• pdf (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
Chapter
🔑 id (text)
• sectionId (text)
• title (text)
• description (text)
• totalSlide (integer)
• chapterNumber (integer)
• lessonDuration (integer)
• isPublished (boolean)
+ 3 more columns...
ChapterCategoryRating
🔑 id (text)
• chapterReviewId (text)
• category (text)
• categoryId (text)
• label (text)
• rating (integer)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
ChapterProgress
🔑 id (text)
• studentId (text)
• chapterId (text)
• progress (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• isCompleted (boolean)
ChapterReview
🔑 id (text)
• studentId (text)
• chapterId (text)
• comment (text)
• rating (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
Course
🔑 id (text)
• creatorId (text)
• title (text)
• coverIcon (text)
• description (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
+ 1 more columns...
CourseCategoryRating
🔑 id (text)
• courseReviewId (text)
• category (text)
• categoryId (text)
• label (text)
• rating (integer)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CourseIntro
🔑 id (text)
• courseId (text)
• title (text)
• summary (text)
• bannerImage (text)
• thumbnail (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
CourseProgress
🔑 id (text)
• studentId (text)
• courseId (text)
• progress (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• isCompleted (boolean)
CourseReview
🔑 id (text)
• studentId (text)
• courseId (text)
• comment (text)
• rating (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
DocumentOnSlide
🔑 id (text)
• fileName (text)
• file (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• courseId (text)
FAQOnSlide
🔑 id (text)
• slideId (text)
• message (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• userId (text)
FeedbackOnSlide
🔑 id (text)
• userId (text)
• slideId (text)
• message (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
FinalExam
🔑 id (text)
• courseId (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• questionToBeAnswered (integer)
• marksToPass (integer)
• description (text)
FinalTest
🔑 id (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• description (text)
• marksToPass (integer)
• questionToBeAnswered (integer)
• courseId (text)
Hospital
🔑 id (text)
• name (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• activeChws (integer)
• cell (text)
• chwSupervisor (text)
• chwSupervisorContact (text)
+ 8 more columns...
MessageUnreadCounter
🔑 userId (text)
• totalUnread (integer)
• updatedAt (timestamp without time zone)
MidTest
🔑 id (text)
• chapterId (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• description (text)
• marksToPass (integer)
• questionToBeAnswered (integer)
Notification
🔑 id (text)
• userId (text)
• title (text)
• message (text)
• type (USER-DEFINED)
• isRead (boolean)
• actionUrl (character varying)
• entityType (character varying)
+ 4 more columns...
NotificationPushToken
🔑 id (text)
• userId (text)
• token (character varying)
• platform (text)
• deviceId (character varying)
• expiresAt (timestamp without time zone)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
Option
🔑 id (text)
• label (text)
• image (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• questionnaireId (text)
PreTest
🔑 id (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• description (text)
• marksToPass (integer)
• questionToBeAnswered (integer)
• courseId (text)
Questionnaire
🔑 id (text)
• question (text)
• questionImage (text)
• allowMultiple (boolean)
• midTestId (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• courseId (text)
+ 1 more columns...
Section
🔑 id (text)
• courseId (text)
• title (text)
• description (text)
• totalChapter (integer)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
SectionCategoryRating
🔑 id (text)
• sectionReviewId (text)
• category (text)
• categoryId (text)
• label (text)
• rating (integer)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
SectionReview
🔑 id (text)
• studentId (text)
• sectionId (text)
• comment (text)
• rating (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
Slide
🔑 id (text)
• chapterId (text)
• note (text)
• description (text)
• slideNumber (integer)
• file (text)
• isPublished (boolean)
• createdAt (timestamp without time zone)
+ 1 more columns...
SlideProgress
🔑 id (text)
• studentId (text)
• slideId (text)
• isCompleted (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
Staff
🔑 id (text)
• userId (text)
• role (USER-DEFINED)
Student
🔑 id (text)
• userId (text)
• role (USER-DEFINED)
• status (USER-DEFINED)
StudentOnSlide
🔑 id (text)
• studentId (text)
• slideId (text)
• progress (double precision)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
SystemReview
🔑 id (text)
• userId (text)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
• feedback (text)
• overallRating (double precision)
• recommendation (text)
User
🔑 id (text)
• email (text)
• password (text)
• phoneNumber (text)
• district (text)
• sector (text)
• cell (text)
• village (text)
+ 14 more columns...
UserRole
🔑 id (text)
• userId (text)
• name (USER-DEFINED)
_prisma_migrations
🔑 id (character varying)
• checksum (character varying)
• finished_at (timestamp with time zone)
• migration_name (character varying)
• logs (text)
• rolled_back_at (timestamp with time zone)
• started_at (timestamp with time zone)
• applied_steps_count (integer)
communities
🔑 id (text)
• name (text)
• description (text)
• photo (text)
• lastPostId (text)
• createdById (text)
• isPublic (boolean)
• createdAt (timestamp without time zone)
+ 1 more columns...
community_members
🔑 id (text)
• communityId (text)
• userId (text)
• role (text)
• joinedAt (timestamp without time zone)
community_post_comments
🔑 id (text)
• postId (text)
• userId (text)
• text (text)
• parentId (text)
• timestamp (timestamp without time zone)
community_post_likes
🔑 id (text)
• postId (text)
• userId (text)
• likedAt (timestamp without time zone)
community_posts
🔑 id (text)
• communityId (text)
• authorId (text)
• title (text)
• content (text)
• photo (text)
• isDeleted (boolean)
• editedAt (timestamp without time zone)
+ 4 more columns...
direct_chats
🔑 id (text)
• userId1 (text)
• userId2 (text)
• lastMessageId (text)
• isArchived (boolean)
• createdAt (timestamp without time zone)
• updatedAt (timestamp without time zone)
direct_message_likes
🔑 id (text)
• messageId (text)
• userId (text)
• likedAt (timestamp without time zone)
direct_message_reads
🔑 id (text)
• messageId (text)
• userId (text)
• readAt (timestamp without time zone)
direct_messages
🔑 id (text)
• chatId (text)
• senderId (text)
• content (text)
• type (text)
• attachments (text)
• isDeleted (boolean)
• editedAt (timestamp without time zone)
+ 3 more columns...
fired_reminders
🔑 id (integer)
• event_id (text)
• user_id (text)
• fire_at (timestamp without time zone)
• minutes_before (integer)
• fired_at (timestamp without time zone)
group_chat_participants
🔑 id (text)
• groupId (text)
• userId (text)
• role (text)
• joinedAt (timestamp without time zone)
group_chats
🔑 id (text)
• name (text)
• photo (text)
• description (text)
• lastMessageId (text)
• createdById (text)
• isArchived (boolean)
• createdAt (timestamp without time zone)
+ 1 more columns...
group_comments
🔑 id (text)
• messageId (text)
• userId (text)
• text (text)
• parentId (text)
• timestamp (timestamp without time zone)
group_message_likes
🔑 id (text)
• messageId (text)
• userId (text)
• likedAt (timestamp without time zone)
group_message_reads
🔑 id (text)
• messageId (text)
• userId (text)
• readAt (timestamp without time zone)
group_messages
🔑 id (text)
• groupId (text)
• senderId (text)
• content (text)
• type (text)
• attachments (text)
• isDeleted (boolean)
• editedAt (timestamp without time zone)
+ 4 more columns...

Database Tables (60)

Announcement (11 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
title text NO None None No description
body text NO None None No description
segment text NO None None No description
priority text NO 'medium'::text None No description
status text NO 'draft'::text None No description
publishAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
validUntil timestamp without time zone YES None None No description
createdById text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → Announcement.id (PRIMARY KEY)

Answer (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
label text NO None None No description
image text YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
questionnaireId text NO None None No description

Table Relationships

  • id → Answer.id (PRIMARY KEY)

AttempTest (11 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
preTestId text YES None None No description
midTestId text YES None None No description
finalTestId text YES None None No description
tryCount integer(32) NO 1 None No description
marks double precision(53) NO 0.0 None No description
isCompleted boolean NO false None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
finalExamId text YES None None No description

Table Relationships

  • id → AttempTest.id (PRIMARY KEY)

AttemptAnswer (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
attemptId text NO None None No description
questionnaireId text NO None None No description
selectedAnswerIds ARRAY YES None None No description
isCorrect boolean NO false None No description
marks double precision(53) NO 0.0 None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → AttemptAnswer.id (PRIMARY KEY)

CalendarEvent (22 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
title text NO None None No description
description text YES None None No description
type USER-DEFINED NO 'TRAINING'::"CalendarEventType" None No description
frequency USER-DEFINED NO 'NONE'::"CalendarFrequency" None No description
daysOfWeek ARRAY YES ARRAY[]::integer[] None No description
timezone text NO 'Africa/Kigali'::text None No description
startAt timestamp without time zone NO None None No description
endAt timestamp without time zone YES None None No description
allDay boolean NO false None No description
recurrenceEndsAt timestamp without time zone YES None None No description
createdById text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
hostEmail text YES None None No description
location text YES None None No description
meetingType USER-DEFINED YES 'EBUMENYI_MEETING'::"MeetingType" None No description
priority USER-DEFINED NO 'MEDIUM'::"EventPriority" None No description
reminderMinutesBefore ARRAY YES ARRAY[30] None No description
commonId text YES None None No description
isCancelled boolean NO false None No description
isRepeating boolean NO false None No description

Table Relationships

  • id → CalendarEvent.id (PRIMARY KEY)

CalendarEventAttachment (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
eventId text NO None None No description
name text NO None None No description
url text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CalendarEventAttachment.id (PRIMARY KEY)

CalendarEventExternalParticipant (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
eventId text NO None None No description
email text NO None None No description
name text YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CalendarEventExternalParticipant.id (PRIMARY KEY)

CalendarEventParticipant (5 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
eventId text NO None None No description
userId text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CalendarEventParticipant.id (PRIMARY KEY)

CategoryRating (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
systemReviewId text NO None None No description
category text NO None None No description
label text NO None None No description
rating integer(32) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
categoryId text NO None None No description

Table Relationships

  • id → CategoryRating.id (PRIMARY KEY)

Certificate (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
courseId text NO None None No description
pdf text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → Certificate.id (PRIMARY KEY)

Chapter (11 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
sectionId text NO None None No description
title text NO None None No description
description text YES None None No description
totalSlide integer(32) NO 0 None No description
chapterNumber integer(32) NO None None No description
lessonDuration integer(32) NO 5 None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
activityAt integer(32) YES None None No description

Table Relationships

  • id → Chapter.id (PRIMARY KEY)

ChapterCategoryRating (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
chapterReviewId text NO None None No description
category text NO None None No description
categoryId text NO None None No description
label text NO None None No description
rating integer(32) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → ChapterCategoryRating.id (PRIMARY KEY)

ChapterProgress (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
chapterId text NO None None No description
progress double precision(53) NO 0.0 None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
isCompleted boolean NO false None No description

Table Relationships

  • id → ChapterProgress.id (PRIMARY KEY)

ChapterReview (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
chapterId text NO None None No description
comment text NO None None No description
rating double precision(53) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → ChapterReview.id (PRIMARY KEY)

Course (9 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
creatorId text NO None None No description
title text NO None None No description
coverIcon text NO None None No description
description text YES None None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
rating double precision(53) NO 0.0 None No description

Table Relationships

  • id → Course.id (PRIMARY KEY)

CourseCategoryRating (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
courseReviewId text NO None None No description
category text NO None None No description
categoryId text NO None None No description
label text NO None None No description
rating integer(32) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CourseCategoryRating.id (PRIMARY KEY)

CourseIntro (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
courseId text NO None None No description
title text NO None None No description
summary text NO None None No description
bannerImage text YES None None No description
thumbnail text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CourseIntro.id (PRIMARY KEY)

CourseProgress (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
courseId text NO None None No description
progress double precision(53) NO 0.0 None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
isCompleted boolean NO false None No description

Table Relationships

  • id → CourseProgress.id (PRIMARY KEY)

CourseReview (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
courseId text NO None None No description
comment text NO None None No description
rating double precision(53) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → CourseReview.id (PRIMARY KEY)

DocumentOnSlide (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
fileName text NO None None No description
file text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
courseId text NO None None No description

Table Relationships

  • id → DocumentOnSlide.id (PRIMARY KEY)

FAQOnSlide (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
slideId text NO None None No description
message text NO None None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
userId text NO None None No description

Table Relationships

  • id → FAQOnSlide.id (PRIMARY KEY)

FeedbackOnSlide (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
slideId text NO None None No description
message text NO None None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → FeedbackOnSlide.id (PRIMARY KEY)

FinalExam (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
courseId text YES None None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
questionToBeAnswered integer(32) NO 1 None No description
marksToPass integer(32) NO 0 None No description
description text YES None None No description

Table Relationships

  • id → FinalExam.id (PRIMARY KEY)

FinalTest (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
description text YES None None No description
marksToPass integer(32) NO 0 None No description
questionToBeAnswered integer(32) NO 1 None No description
courseId text YES None None No description

Table Relationships

  • id → FinalTest.id (PRIMARY KEY)

Hospital (16 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
name text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
activeChws integer(32) YES 0 None No description
cell text YES None None No description
chwSupervisor text YES None None No description
chwSupervisorContact text YES None None No description
contact text YES None None No description
district text YES None None No description
email text YES None None No description
sector text YES None None No description
totalChws integer(32) YES 0 None No description
village text YES None None No description
catchmentArea ARRAY YES ARRAY[]::text[] None No description
province text YES None None No description

Table Relationships

  • id → Hospital.id (PRIMARY KEY)

MessageUnreadCounter (3 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
userId text NO None Primary Key No description
totalUnread integer(32) NO 0 None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • userId → MessageUnreadCounter.userId (PRIMARY KEY)

MidTest (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
chapterId text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
description text YES None None No description
marksToPass integer(32) NO 0 None No description
questionToBeAnswered integer(32) NO 1 None No description

Table Relationships

  • id → MidTest.id (PRIMARY KEY)

Notification (12 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
title text NO None None No description
message text NO None None No description
type USER-DEFINED NO 'info'::"NotificationType" None No description
isRead boolean NO false None No description
actionUrl character varying(500) YES None None No description
entityType character varying(50) YES None None No description
entityId text YES None None No description
metadata jsonb YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → Notification.id (PRIMARY KEY)

NotificationPushToken (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
token character varying(500) NO None None No description
platform text NO 'web'::text None No description
deviceId character varying(200) YES None None No description
expiresAt timestamp without time zone YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → NotificationPushToken.id (PRIMARY KEY)

Option (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
label text NO None None No description
image text YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
questionnaireId text NO None None No description

Table Relationships

  • id → Option.id (PRIMARY KEY)

PreTest (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
description text YES None None No description
marksToPass integer(32) NO 0 None No description
questionToBeAnswered integer(32) NO 1 None No description
courseId text YES None None No description

Table Relationships

  • id → PreTest.id (PRIMARY KEY)

Questionnaire (9 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
question text NO None None No description
questionImage text YES None None No description
allowMultiple boolean NO false None No description
midTestId text YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
courseId text YES None None No description
feedbackStatement text YES None None No description

Table Relationships

  • id → Questionnaire.id (PRIMARY KEY)

Section (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
courseId text NO None None No description
title text NO None None No description
description text YES None None No description
totalChapter integer(32) NO 0 None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → Section.id (PRIMARY KEY)

SectionCategoryRating (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
sectionReviewId text NO None None No description
category text NO None None No description
categoryId text NO None None No description
label text NO None None No description
rating integer(32) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → SectionCategoryRating.id (PRIMARY KEY)

SectionReview (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
sectionId text NO None None No description
comment text NO None None No description
rating double precision(53) NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → SectionReview.id (PRIMARY KEY)

Slide (9 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
chapterId text NO None None No description
note text YES None None No description
description text YES None None No description
slideNumber integer(32) NO None None No description
file text YES None None No description
isPublished boolean NO true None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → Slide.id (PRIMARY KEY)

SlideProgress (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
slideId text NO None None No description
isCompleted boolean NO false None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → SlideProgress.id (PRIMARY KEY)

Staff (3 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
role USER-DEFINED NO 'STAFF'::"RoleType" None No description

Table Relationships

  • id → Staff.id (PRIMARY KEY)

Student (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
role USER-DEFINED NO 'TRAINEE'::"RoleType" None No description
status USER-DEFINED NO 'ACTIVE'::"StudentStatus" None No description

Table Relationships

  • id → Student.id (PRIMARY KEY)

StudentOnSlide (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
studentId text NO None None No description
slideId text NO None None No description
progress double precision(53) NO 0.0 None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → StudentOnSlide.id (PRIMARY KEY)

SystemReview (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
feedback text NO None None No description
overallRating double precision(53) NO None None No description
recommendation text NO None None No description

Table Relationships

  • id → SystemReview.id (PRIMARY KEY)

User (22 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
email text YES None None No description
password text NO None None No description
phoneNumber text NO None None No description
district text NO None None No description
sector text NO None None No description
cell text NO None None No description
village text NO None None No description
NID text YES None None No description
birthdate timestamp without time zone YES None None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description
otp text YES None None No description
otpExpiresAt timestamp without time zone YES None None No description
photo text NO 'https://img.freepik.com/premium-vector/user-profile-icon-flat-style-member-avatar-vector-illustration-isolated-background-human-permission-sign-business-concept_157943-15752.jpg'::text None No description
fullNames text NO None None No description
gender text YES None None No description
video text YES None None No description
audio text YES None None No description
bio text YES None None No description
industry USER-DEFINED YES None None No description
hospitalId text YES None None No description

Table Relationships

  • id → User.id (PRIMARY KEY)

UserRole (3 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId text NO None None No description
name USER-DEFINED NO None None No description

Table Relationships

  • id → UserRole.id (PRIMARY KEY)

_prisma_migrations (8 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id character varying(36) NO None Primary Key No description
checksum character varying(64) NO None None No description
finished_at timestamp with time zone YES None None No description
migration_name character varying(255) NO None None No description
logs text YES None None No description
rolled_back_at timestamp with time zone YES None None No description
started_at timestamp with time zone NO now() None No description
applied_steps_count integer(32) NO 0 None No description

Table Relationships

  • id → _prisma_migrations.id (PRIMARY KEY)

communities (9 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
name text NO None None No description
description text YES None None No description
photo text YES 'https://res.cloudinary.com/dleiqpvue/image/upload/v1759124054/rbc-removebg-preview_k8xhjr.png'::text None No description
lastPostId text YES None None No description
createdById text NO None None No description
isPublic boolean NO false None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → communities.id (PRIMARY KEY)

community_members (5 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
communityId text NO None None No description
userId text NO None None No description
role text NO 'member'::text None No description
joinedAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → community_members.id (PRIMARY KEY)

community_post_comments (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
postId text NO None None No description
userId text NO None None No description
text text NO None None No description
parentId text YES None None No description
timestamp timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → community_post_comments.id (PRIMARY KEY)

community_post_likes (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
postId text NO None None No description
userId text NO None None No description
likedAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → community_post_likes.id (PRIMARY KEY)

community_posts (12 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
communityId text NO None None No description
authorId text NO None None No description
title text NO None None No description
content text NO None None No description
photo text YES None None No description
isDeleted boolean NO false None No description
editedAt timestamp without time zone YES None None No description
viewCount integer(32) NO 0 None No description
likeCount integer(32) NO 0 None No description
commentCount integer(32) NO 0 None No description
timestamp timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → community_posts.id (PRIMARY KEY)

direct_chats (7 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
userId1 text NO None None No description
userId2 text NO None None No description
lastMessageId text YES None None No description
isArchived boolean NO false None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → direct_chats.id (PRIMARY KEY)

direct_message_likes (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
messageId text NO None None No description
userId text NO None None No description
likedAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → direct_message_likes.id (PRIMARY KEY)

direct_message_reads (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
messageId text NO None None No description
userId text NO None None No description
readAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → direct_message_reads.id (PRIMARY KEY)

direct_messages (11 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
chatId text NO None None No description
senderId text NO None None No description
content text NO None None No description
type text NO 'text'::text None No description
attachments text YES None None No description
isDeleted boolean NO false None No description
editedAt timestamp without time zone YES None None No description
readCount integer(32) NO 0 None No description
likeCount integer(32) NO 0 None No description
timestamp timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → direct_messages.id (PRIMARY KEY)

fired_reminders (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id integer(32) NO nextval('fired_reminders_id_seq'::regclass) Primary Key No description
event_id text NO None None No description
user_id text NO None None No description
fire_at timestamp without time zone NO None None No description
minutes_before integer(32) NO None None No description
fired_at timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → fired_reminders.id (PRIMARY KEY)

group_chat_participants (5 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
groupId text NO None None No description
userId text NO None None No description
role text NO 'member'::text None No description
joinedAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → group_chat_participants.id (PRIMARY KEY)

group_chats (9 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
name text NO None None No description
photo text YES 'https://res.cloudinary.com/dleiqpvue/image/upload/v1759124054/rbc-removebg-preview_k8xhjr.png'::text None No description
description text YES None None No description
lastMessageId text YES None None No description
createdById text NO None None No description
isArchived boolean NO false None No description
createdAt timestamp without time zone NO CURRENT_TIMESTAMP None No description
updatedAt timestamp without time zone NO None None No description

Table Relationships

  • id → group_chats.id (PRIMARY KEY)

group_comments (6 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
messageId text NO None None No description
userId text NO None None No description
text text NO None None No description
parentId text YES None None No description
timestamp timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → group_comments.id (PRIMARY KEY)

group_message_likes (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
messageId text NO None None No description
userId text NO None None No description
likedAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → group_message_likes.id (PRIMARY KEY)

group_message_reads (4 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
messageId text NO None None No description
userId text NO None None No description
readAt timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → group_message_reads.id (PRIMARY KEY)

group_messages (12 columns)

â–¼
Column Name Data Type Nullable Default Value Constraints Description
id text NO None Primary Key No description
groupId text NO None None No description
senderId text NO None None No description
content text NO None None No description
type text NO 'text'::text None No description
attachments text YES None None No description
isDeleted boolean NO false None No description
editedAt timestamp without time zone YES None None No description
readCount integer(32) NO 0 None No description
likeCount integer(32) NO 0 None No description
commentCount integer(32) NO 0 None No description
timestamp timestamp without time zone NO CURRENT_TIMESTAMP None No description

Table Relationships

  • id → group_messages.id (PRIMARY KEY)