Merge branch 'MDL-41756-master' of https://github.com/jamiepratt/moodle
[moodle.git] / lib / db / upgrade.php
index 6aff33e..3f7b51c 100644 (file)
@@ -3005,5 +3005,19 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2014012400.00);
     }
 
+    if ($oldversion < 2014020500.00) {
+        // Define field variant to be added to question_statistics.
+        $table = new xmldb_table('question_statistics');
+        $field = new xmldb_field('variant', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'subquestion');
+
+        // Conditionally launch add field variant.
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Main savepoint reached.
+        upgrade_main_savepoint(true, 2014020500.00);
+    }
+
     return true;
 }