Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-28512 qtype essay: clean up garbage qtype_essay_options rows.

  • Loading branch information...
commit fbfa572d706bfd9d04e79c7f34937244cf3ee3cd 1 parent 19835d4
@timhunt timhunt authored
View
9 question/type/essay/db/upgrade.php
@@ -107,6 +107,15 @@ function xmldb_qtype_essay_upgrade($oldversion) {
// Moodle v2.4.0 release upgrade line
// Put any upgrade step following this
+ if ($oldversion < 2013011800) {
+ // Then we delete the old question_answers rows for essay questions.
+ $DB->delete_records_select('qtype_essay_options', "NOT EXISTS (
+ SELECT 1 FROM {question} WHERE qtype = 'essay' AND
+ {question}.id = {qtype_essay_options}.questionid)");
+
+ // Essay savepoint reached.
+ upgrade_plugin_savepoint(true, 2013011800, 'qtype', 'essay');
+ }
return true;
}
View
2  question/type/essay/version.php
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qtype_essay';
-$plugin->version = 2012112900;
+$plugin->version = 2013011800;
$plugin->requires = 2012112900;
Please sign in to comment.
Something went wrong with that request. Please try again.