Skip to main content

Users & Classrooms

Tables

users

This table stores information about users in the system, including their roles and statuses.

View fields and relationships

  • id: UUID, Primary Key
  • created_at: Timestamp with time zone, The time when the user was created.
  • email: Text, User's email address.
  • first_name: Text, User's first name.
  • last_name: Text, User's last name.
  • role: user_role, Role of the user (e.g., student, instructor).
  • status: user_status, Current status of the user (e.g., active, inactive).
  • pid: varchar, Personal identifier for the user.
  • is_consent: boolean, Indicates whether the user has given consent.
  • Indexes: Primary Key on id
  • Relationships: One-to-Many with classes (as instructor), Many-to-Many with classes (as student through user_class)

classes

This table contains information about classrooms, including the instructor and class details.

View fields and relationships

  • id: UUID, Primary Key
  • created_at: Timestamp with time zone, The time when the class was created.
  • class_title: Text, Title of the class.
  • class_code: Text, Unique code for the class.
  • instructor_id: UUID, Foreign Key referencing users(id), the instructor for the class.
  • class_hex_color: Text, Hex color code for the class.
  • class_image_cover: Text, URL or path to the class cover image.
  • class_description: Text, Description of the class.
  • Indexes: Primary Key on id, Foreign Key on instructor_id
  • Relationships: Many-to-One with users (instructor)

user_class

Junction table managing the many-to-many relationship between users and classes (student enrollments).

View fields and relationships

  • id: UUID, Primary Key
  • created_at: Timestamp with time zone, The time when the enrollment record was created.
  • student_id: UUID, Foreign Key referencing users(id), the student in the enrollment.
  • class_id: UUID, Foreign Key referencing classes(id), the class in the enrollment.
  • enrollment_status: registration_status, Status of the student's enrollment (e.g., registered, pending).
  • Indexes: Primary Key on id, Foreign Keys on student_id, class_id
  • Relationships: Many-to-One with users (student), Many-to-One with classes