NOMDL workshop: improved SQL execution, use one query instead of loop

This commit is contained in:
David Mudrak 2010-09-17 13:26:10 +00:00
parent 1149b075c7
commit 5452309a58

View File

@ -51,9 +51,7 @@ function xmldb_workshop_upgrade($oldversion) {
WHERE ws.id IS NULL');
if (!empty($orphans)) {
echo $OUTPUT->notification('Orphaned assessment records found - cleaning...');
foreach (array_keys($orphans) as $waid) {
$DB->delete_records('workshop_assessments', 'id', $waid);
}
$DB->delete_records_list('workshop_assessments', 'id', array_keys($orphans));
}
upgrade_mod_savepoint(true, 2007101510, 'workshop');
}