Course Table Schema (course)


Central course table

course table columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigint 10 null
backup_courses.courseid Implied Constraint R
badge.courseid badg_cou2_fk R
block_recent_activity.courseid Implied Constraint R
competency_coursecomp.courseid compcour_cou3_fk R
competency_coursecompsetting.courseid Implied Constraint R
competency_usercompcourse.courseid Implied Constraint R
course_completion_aggr_methd.course coursecomplaggrmeth_cou_fk R
course_completion_crit_compl.course courcomplcritcoml_cou_fk R
course_completion_criteria.course courcompcrit_cou_fk R
course_completion_criteria.courseinstance courcompcrit_cin_fk R
course_completion_defaults.course courcompdefa_cou2_fk R
course_completions.course courcompl_cou_fk R
course_format_options.courseid courformopti_cou2_fk R
course_modules.course courmodu_cou_fk R
course_published.courseid Implied Constraint R
enrol.courseid enro_cou2_fk R
enrol_flatfile.courseid enroflat_cou2_fk R
enrol_paypal.courseid Implied Constraint R
event.courseid Implied Constraint R
event_subscriptions.courseid Implied Constraint R
feedback_completed.courseid Implied Constraint R
feedback_completedtmp.courseid Implied Constraint R
feedback_sitecourse_map.courseid Implied Constraint R
grade_categories.courseid gradcate_cou2_fk R
grade_categories_history.courseid gradcatehist_cou2_fk R
grade_items.courseid graditem_cou2_fk R
grade_items_history.courseid graditemhist_cou2_fk R
grade_outcomes.courseid gradoutc_cou2_fk R
grade_outcomes_courses.courseid gradoutccour_cou2_fk R
grade_outcomes_history.courseid gradoutchist_cou2_fk R
grade_settings.courseid gradsett_cou2_fk R
groupings.courseid grou_cou4_fk R
groups.courseid grou_cou3_fk R
local_ld_course.courseid localdcour_cou2_fk R
local_ld_lastactivity.courseid Implied Constraint R
local_ld_lastactivity.coursemoduleid Implied Constraint R
logstore_standard_log.courseid Implied Constraint R
lti_tool_settings.course ltitoolsett_cou3_fk R
post.courseid Implied Constraint R
post.coursemoduleid Implied Constraint R
scale.courseid Implied Constraint R
scale_history.courseid scalhist_cou2_fk R
stats_daily.courseid Implied Constraint R
stats_monthly.courseid Implied Constraint R
stats_user_daily.courseid Implied Constraint R
stats_user_monthly.courseid Implied Constraint R
stats_user_weekly.courseid Implied Constraint R
stats_weekly.courseid Implied Constraint R
tool_monitor_events.courseid Implied Constraint R
tool_monitor_rules.courseid Implied Constraint R
tool_monitor_subscriptions.courseid Implied Constraint R
tool_recyclebin_course.courseid toolrecycour_cou2_fk R
user_lastaccess.courseid Implied Constraint R
workshop.course work_cou2_fk R
category bigint 10 0 courcate_cat_fk R
sortorder bigint 10 0
fullname varchar 254
shortname varchar 255
idnumber varchar 100
summary longtext 2147483647 null
summaryformat tinyint 2 0
format varchar 21 topics
showgrades tinyint 2 1
newsitems mediumint 5 1
startdate bigint 10 0
enddate bigint 10 0
marker bigint 10 0
maxbytes bigint 10 0
legacyfiles smallint 4 0

course files are not necessary any more: 0 no legacy files, 1 legacy files disabled, 2 legacy files enabled

showreports smallint 4 0
visible BIT 1 1
visibleold BIT 1 1

the state of visible field when hiding parent category, this helps us to recover hidden states when unhiding the parent category later

groupmode smallint 4 0
groupmodeforce smallint 4 0
defaultgroupingid bigint 10 0

default grouping used in course modules, does not have key intentionally

lang varchar 30
calendartype varchar 30
theme varchar 50
timecreated bigint 10 0
timemodified bigint 10 0
requested BIT 1 0
enablecompletion BIT 1 0

1 = allow use of 'completion' progress-tracking on this course. 0 = disable completion tracking on this course.

completionnotify BIT 1 0

Notify users when they complete this course

cacherev bigint 10 0

Incrementing revision for validating the course content cache

Table contained -1 rows

course table indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc id
cour_cat_ix Performance Asc category
cour_idn_ix Performance Asc idnumber
cour_sho_ix Performance Asc shortname
cour_sor_ix Performance Asc sortorder

course table relationships