mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'MDL-70285' of https://github.com/timhunt/moodle
This commit is contained in:
commit
7430e7c074
1 changed files with 6 additions and 5 deletions
|
@ -2786,11 +2786,12 @@ function xmldb_main_upgrade($oldversion) {
|
||||||
if ($oldversion < 2021052500.26) {
|
if ($oldversion < 2021052500.26) {
|
||||||
// Delete orphaned course_modules_completion rows; these were not deleted properly
|
// Delete orphaned course_modules_completion rows; these were not deleted properly
|
||||||
// by remove_course_contents function.
|
// by remove_course_contents function.
|
||||||
$DB->delete_records_subquery('course_modules_completion', 'id', 'id',
|
$DB->delete_records_select('course_modules_completion', "
|
||||||
"SELECT cmc.id
|
NOT EXISTS (
|
||||||
FROM {course_modules_completion} cmc
|
SELECT 1
|
||||||
LEFT JOIN {course_modules} cm ON cm.id = cmc.coursemoduleid
|
FROM {course_modules} cm
|
||||||
WHERE cm.id IS NULL");
|
WHERE cm.id = {course_modules_completion}.coursemoduleid
|
||||||
|
)");
|
||||||
upgrade_main_savepoint(true, 2021052500.26);
|
upgrade_main_savepoint(true, 2021052500.26);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue