L&D learning schema (Supabase)
Audience: Platform engineering
Status: Active (schema deployed 2026-04-13)
Linear: PLT-1284
Project
L&D catalog and progress tables live in the Internal AI Core Supabase project (not a separate brainforge-ld instance in the current org). Same project as team, client data, and related internal platform tables.
- Project ref:
kxzonslnqjsceiublxkf(us-east-2)
Use service role or authenticated policies per table when building Forge APIs.
Content hierarchy
Intended model: course → module → lesson (lessons are not yet a first-class table; curriculum content remains in vault markdown under knowledge/people/learning-development/programs/).
| Layer | Table / column | Notes |
|---|---|---|
| Course | learning_courses | Catalog row per course (seeded: foundation, accelerator). |
| Module | learning_modules | Existing modules (M1–M5, A1–A2). |
| Module → course | learning_modules.parent_course | UUID FK → learning_courses.id, backfilled by track. |
Progress tracking
Table: learning_progress (replaces module_progress, removed in the same migration).
Each row is either course-scoped or module-scoped:
course_idset,module_idnull → course-level progress (e.g. “started Foundation”).module_idset,course_idnull → module-level progress (same semantics as legacymodule_progress).
Constraints:
CHECKenforces exactly one ofcourse_id/module_idnon-null.- Partial unique indexes:
(team_member_id, course_id)wherecourse_id IS NOT NULL, and(team_member_id, module_id)wheremodule_id IS NOT NULL. status∈not_started,in_progress,completed,locked(same as before).
Columns mirror the old module progress row: started_at, completed_at, evidence_url, notes, timestamps.
Reporting view
team_learning_summary — rebuilt to join learning_progress only on module rows (module_id IS NOT NULL) so existing “foundation modules completed” and current_module behavior stays aligned with pre-migration logic. Course-only rows do not affect that view until we extend it.
Related tables (unchanged by PLT-1284)
certifications,certification_attempts— still referencelearning_moduleswhere applicable.- Vendor certification progress described in the L&D handoff is not implemented in these tables yet.
Migrations (Supabase)
Applied via Supabase migrations on Internal AI Core:
| Name | Purpose |
|---|---|
learning_course_hierarchy_unified_progress | learning_courses, learning_modules.parent_course, seed courses, learning_progress, data copy from module_progress, drop module_progress, recreate team_learning_summary, RLS/grants/triggers. |
fix_accelerator_course_prerequisite | Set accelerator course prerequisite_course_id → foundation course. |
Application types
Forge TypeScript types live in:
apps/platform/src/lib/types/learning.ts—LearningCourse,LearningProgress,parent_courseonLearningModule; deprecated aliasesModuleProgress*map to the new names for incremental refactors.
L&D-facing summary
For program owners and non-SQL consumers, see:
Related
- Product handoff (questions and roadmap):
../plans/active/ld-supabase-progress-tracking-handoff.md - L&D home:
knowledge/people/learning-development/README.md
Last updated: 2026-04-13