Skip to content

Commit

Permalink
MDL-57649 mod_lesson: Improvement to upgrade query.
Browse files Browse the repository at this point in the history
We only need one record for each filearea that we
are removing.
  • Loading branch information
abgreeve committed Jul 20, 2017
1 parent dda72b9 commit 7b78154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/lesson/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function xmldb_lesson_upgrade($oldversion) {
if ($oldversion < 2017051501) {

// Delete orphaned lesson answer and response files.
$sql = "SELECT DISTINCT f.*
$sql = "SELECT DISTINCT f.contextid, f.component, f.filearea, f.itemid
FROM {files} f
LEFT JOIN {lesson_answers} la ON f.itemid = la.id
WHERE component = :component
Expand Down

0 comments on commit 7b78154

Please sign in to comment.