Files
STCourses/packages/feature-ai/migrations/0002_ai_mentor_prefs.sql
T
Lucas WintherandClaude Opus 5.5 a995900fba feat(ai): per-course mentor preferences table (contract request 4)
0002_ai_mentor_prefs.sql adds ai_mentor_prefs(user_id, course_id, off).
upgradeAiData copies v1 config_json.mentorOff toggles into it once
(marked ai_data_v11 in schema_migrations); the settings repo awaits the
upgrade before first use and aiFeature starts it at construction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:30:59 +01:00

8 lines
480 B
SQL

-- v1.1 (contract request 4): per-course mentor toggles get their own table. A row exists only while the learner
-- has switched the course's mentor rules off. v1 kept them in ai_settings.config_json.mentorOff; reading that JSON
-- is not portable SQL, so upgradeAiData (src/upgrade.ts) copies it on first start.
CREATE TABLE ai_mentor_prefs (
user_id TEXT NOT NULL, course_id TEXT NOT NULL, off INTEGER NOT NULL, updated_at TEXT NOT NULL,
PRIMARY KEY (user_id, course_id)
);