Skip to content

Schema: learn

Part of the generated database reference.

learn_categories

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
name TEXT no β€” β€” β€”
description TEXT yes β€” β€” β€”
icon TEXT yes β€” β€” β€”
color TEXT yes β€” β€” β€”
parent_id UUID yes β€” FK learn_categories.id
sort_order INTEGER no 0 β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”

learn_certificates

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
user_id UUID no β€” β€” β€”
course_id UUID no β€” FK learn_courses.id
issued_at TIMESTAMPTZ no NOW() β€” β€”
score INTEGER no β€” β€” β€”
certificate_url TEXT yes β€” β€” β€”
verification_code TEXT no β€” UQ β€”
expires_at TIMESTAMPTZ yes β€” β€” β€”

learn_course_assignments

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
course_id UUID no β€” FK learn_courses.id
user_id UUID no β€” β€” β€”
assigned_by UUID yes β€” β€” β€”
due_date TIMESTAMPTZ yes β€” β€” β€”
is_mandatory BOOLEAN no TRUE β€” β€”
assigned_at TIMESTAMPTZ no NOW() β€” β€”
completed_at TIMESTAMPTZ yes β€” β€” β€”
reminder_sent BOOLEAN no FALSE β€” β€”
reminder_sent_at TIMESTAMPTZ yes β€” β€” β€”

learn_courses

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
organization_id UUID yes β€” β€” β€”
title TEXT no β€” β€” β€”
description TEXT yes β€” β€” β€”
category TEXT no 'skills' β€” β€”
difficulty TEXT no 'beginner' β€” β€”
duration_minutes INTEGER no 0 β€” β€”
thumbnail_url TEXT yes β€” β€” β€”
is_mandatory BOOLEAN no FALSE β€” β€”
due_days INTEGER yes β€” β€” β€”
is_published BOOLEAN no FALSE β€” β€”
created_by UUID yes β€” β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

learn_lessons

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
course_id UUID no β€” FK learn_courses.id
title TEXT no β€” β€” β€”
content TEXT no β€” β€” β€”
content_type TEXT no 'text' β€” β€”
lesson_order INTEGER no 1 β€” β€”
duration_minutes INTEGER no 0 β€” β€”
video_url TEXT yes β€” β€” β€”
attachments JSONB no '[]' β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

Indexes: idx_learn_lessons_bot_kind(bot_id, kind), idx_learn_lessons_user_created(user_id, created_at DESC)

Drift: in migrations only: bot_id, kind, topic, user_id

learn_quizzes

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
lesson_id UUID yes β€” FK learn_lessons.id
course_id UUID no β€” FK learn_courses.id
title TEXT no β€” β€” β€”
passing_score INTEGER no 70 β€” β€”
time_limit_minutes INTEGER yes β€” β€” β€”
max_attempts INTEGER yes β€” β€” β€”
questions JSONB no '[]' β€” β€”
created_at TIMESTAMPTZ no NOW() β€” β€”
updated_at TIMESTAMPTZ no NOW() β€” β€”

learn_user_progress

  • Domain: learn Β· Feature gate: #[cfg(feature = "learn")] Β· Migration: 6.5.15.1-consolidated
  • Rust source: botschema/src/learn.rs
Column SQL type Null Default Key References
id UUID no gen_random_uuid() PK β€”
user_id UUID no β€” β€” β€”
course_id UUID no β€” FK learn_courses.id
lesson_id UUID yes β€” FK learn_lessons.id
status TEXT no 'not_started' β€” β€”
quiz_score INTEGER yes β€” β€” β€”
quiz_attempts INTEGER no 0 β€” β€”
time_spent_minutes INTEGER no 0 β€” β€”
started_at TIMESTAMPTZ no NOW() β€” β€”
completed_at TIMESTAMPTZ yes β€” β€” β€”
last_accessed_at TIMESTAMPTZ no NOW() β€” β€”