Skip to content

user_lesson_progress

Lesson-level progress events from learners. Append-only, no PK — each interaction produces a new row. A lesson's current state is the sum of its actions.

  • ETL strategy: append (no dedup — there is no PK)

Columns

ColumnTypeDescription
id_tenantBIGINTFK → tenants.id.
id_userBIGINTFK → users.id.
id_itemBIGINTFK → lessons.id. The name item is kept for backward compatibility.
actionSMALLINTProgress delta. Enum — see below.
created_atTIMESTAMPTZEvent timestamp.

Enum · action

SMALLINT storing a progress delta — not a boolean. The current status of a lesson is SUM(action) grouped by (id_user, id_item). If the sum is >= 1, the learner completed it.

ValueMeaning
+1Lesson marked as completed (advance).
-1Completion undone (rollback).
0Viewed without status change.

Computing current status

sql
-- Lessons completed by user X
SELECT id_item AS id_lesson
FROM lms.user_lesson_progress
WHERE id_user = 12345
GROUP BY id_tenant, id_user, id_item
HAVING SUM(action) >= 1;

This table feeds user_product_progress, which already exposes (user, product) completion percentage so you don't need to compute it.

Children

OpenDB · Cademi LMS Data Warehouse