Merge branch 'master_MDL-50620' of https://github.com/danmarsden/moodle
[moodle.git] / mod / scorm / db / upgrade.php
index c926430..73c8818 100644 (file)
@@ -93,5 +93,17 @@ function xmldb_scorm_upgrade($oldversion) {
     // Moodle v3.0.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // MDL-50620 Add mastery override option.
+    if ($oldversion < 2016021000) {
+        $table = new xmldb_table('scorm');
+
+        $field = new xmldb_field('masteryoverride', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'lastattemptlock');
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        upgrade_mod_savepoint(true, 2016021000, 'scorm');
+    }
+
     return true;
 }