function course_update_7146 in Course 7.2
Delete orphaned course report records.
File
- ./
course.install, line 1335 - course.install Install and update functions for Courses.
Code
function course_update_7146() {
$result = db_query('DELETE cr.* FROM {course_report} cr
LEFT JOIN {course_enrollment} ce ON (ce.uid = cr.uid AND ce.nid = cr.nid)
WHERE ce.eid IS NULL');
return t('Deleted @rows orphaned records.', array(
'@rows' => $result
->rowCount(),
));
}