Skip to main content

milestonecourses

info

Upcoming change — not yet released. The behavior described below relies on a BI Connector 2 update that has not shipped yet.

milestonecourses

Each row links a course or course group to a milestone within a learning path, with a requirement that defines how that course or course group counts toward milestone completion. Every row belongs to exactly one milestone in the milestones table.

Full schema

View all columns and table relationships

Status group

Yes, this table includes a statusgroup column. See Status Group for details.

A milestonecourses row's statusgroup reflects both its own state (the deleted and archived columns on the row) and its parent milestone's state. If the parent milestone has statusgroup = 'd' or 'i', the child row inherits that status even when the child's own deleted or archived is false.

Column details

For columns that appear across many tables (id, companyid, createdat, updatedat, statusgroup), see Common Columns. The columns below are specific to milestonecourses.

milestoneid: id of the parent milestone. Joins to milestones.id.

requirement: how this course or course group contributes toward milestone completion. Values are configured per-milestone in the learning-path setup and typically describe whether the course is required, optional, or counts toward a credit or completion threshold.

contentgrouping, courseid, and coursegroupid

A milestonecourses row points to either a single course or a course group. contentgrouping indicates which:

  • course: the row targets a single course. courseid is set (joins to courses.id) and coursegroupid is null.
  • courseGroup: the row targets a course group. coursegroupid is set (joins to coursegroups.id) and courseid is null.

To resolve the target content for any milestonecourses row, branch on contentgrouping and use the corresponding id.

Sample query

select
t.milestoneid,
t.contentgrouping,
t.courseid,
t.coursegroupid,
t.requirement
from milestonecourses as t
where t.statusgroup = 'a'
limit 100

Joining to milestones

Every milestonecourses row belongs to a milestone. Join via milestonecourses.milestoneid = milestones.id:

select
m.learningpathid,
m.name as milestone_name,
mc.contentgrouping,
mc.courseid,
mc.coursegroupid,
mc.requirement
from milestonecourses as mc
inner join milestones as m on m.id = mc.milestoneid
where mc.statusgroup = 'a'
and m.statusgroup = 'a'
limit 100

Joining to courses or course groups

Because a milestonecourses row points to either a course or a course group (not both), the join is conditional on contentgrouping. Use a left join against both target tables to resolve the title regardless of which side is populated:

select
mc.milestoneid,
mc.contentgrouping,
mc.requirement,
c.title as course_title,
cg.title as coursegroup_title
from milestonecourses as mc
left join courses as c on c.id = mc.courseid
left join coursegroups as cg on cg.id = mc.coursegroupid
where mc.statusgroup = 'a'
limit 100