Tuter

Tables (17)

attendances

  • attendance_id (Key) — Primary key — NOT NULL
  • attended — BOOLEAN
  • checked_at — TIMESTAMP
  • lesson_id (Key2) — Foreign key → lessons.lesson_id — NOT NULL
  • user_id (Key3) — Foreign key → users.user_id — NOT NULL

chat_channels

  • channel_id (Key) — Primary key — NOT NULL
  • name — VARCHAR(100)
  • created_at — TIMESTAMP
  • subject_id (Key2) — Foreign key → subjects.subject_id — NOT NULL

chat_messages

  • message_id (Key) — Primary key — NOT NULL
  • sender_id — INT — NOT NULL
  • message — TEXT
  • created_at — TIMESTAMP
  • channel_id (Key2) — Foreign key → chat_channels.channel_id — NOT NULL

chat_participants

  • participant_id (Key3) — Primary key — NOT NULL
  • channel_id (Key) — Foreign key → chat_channels.channel_id — NOT NULL
  • user_id (Key2) — Foreign key → users.user_id — NOT NULL

files

  • file_id (Key) — Primary key — NOT NULL
  • uploader_id — INT — NOT NULL
  • file_name — VARCHAR(255)
  • uploaded_at — TIMESTAMP
  • lesson_id (Key2) — Foreign key → lessons.lesson_id — NOT NULL

lesson_participants

  • lesson_participants_id (Key) — Primary key — NOT NULL
  • lesson_id (Key2) — Foreign key → lessons.lesson_id — NOT NULL
  • user_id (Key3) — Foreign key → users.user_id — NOT NULL

lessons

  • lesson_id (Key2) — Primary key — NOT NULL
  • title — VARCHAR(100)
  • start_time — DATETIME
  • end_time — DATETIME
  • location — VARCHAR(100)
  • subject_id (Key) — Foreign key → subjects.subject_id — NOT NULL

notifications

  • notification_id (Key) — Primary key — NOT NULL
  • message — TEXT
  • type — ENUM('info', 'alert', 'reminder')
  • created_at — TIMESTAMP
  • user_id (Key2) — Foreign key → users.user_id — NOT NULL

parent_student_links

  • link_id — INT
  • parent_id — INT — NOT NULL
  • student_id — INT — NOT NULL

parents

  • occupation — VARCHAR(100)
  • relation — VARCHAR(50)
  • user_id (Key) — Foreign key → users.user_id — NOT NULL

payments

  • payment_id (Key) — Primary key — NOT NULL
  • payer_id — INT — NOT NULL
  • receiver_id — INT — NOT NULL
  • amount — DECIMAL(10, 2)
  • paid_at — TIMESTAMP
  • status — ENUM('pending', 'completed', 'failed')

reviews

  • review_id (Key) — Primary key — NOT NULL
  • reviewer_id — INT — NOT NULL
  • target_id — INT — NOT NULL
  • rating — INT
  • comment — TEXT — EX
  • created_at — TIMESTAMP
  • lesson_id (Key2) — Foreign key → lessons.lesson_id — NOT NULL

students

  • school_name — VARCHAR(100)
  • grade — INT
  • user_id (Key) — Foreign key → users.user_id — NOT NULL

subjects

  • subject_id (Key) — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL

teachers

  • university — VARCHAR(100)
  • subject_specialty — VARCHAR(100)
  • experience_years — INT
  • user_id (Key) — Foreign key → users.user_id — NOT NULL

todos

  • todo_id (Key) — Primary key — NOT NULL
  • title — VARCHAR(100)
  • due_date — DATE
  • priority — ENUM('low', 'medium', 'high')
  • completed — BOOLEAN
  • created_at — TIMESTAMP
  • user_id (Key2) — Foreign key → users.user_id — NOT NULL
  • subject_id (Key3) — Foreign key → subjects.subject_id — NOT NULL

users

  • user_id (Key) — Primary key — NOT NULL
  • name — VARCHAR(100)
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • phone — VARCHAR(20)
  • role — ENUM('student', 'teacher', 'parent') — NOT NULL
  • created_at — TIMESTAMP