-- Personal student list for tutoring scenarios (student doesn't need to be in any class)
CREATE TABLE teacher_students (
  teacher_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  student_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  added_at   TEXT NOT NULL DEFAULT (datetime('now')),
  note       TEXT NOT NULL DEFAULT '',
  PRIMARY KEY (teacher_id, student_id)
);
CREATE INDEX idx_teacher_students_student ON teacher_students(student_id);
