Merge branch 'MDL-65959-master' of git://github.com/peterRd/moodle
[moodle.git] / lib / db / upgrade.php
index 7da92b5..424abe2 100644 (file)
@@ -2774,6 +2774,7 @@ function xmldb_main_upgrade($oldversion) {
 
         // Add example field.
         $field = new xmldb_field('example', XMLDB_TYPE_TEXT, null, null, null, null, null, 'tutorial');
+
         if (!$dbman->field_exists($table, $field)) {
             $dbman->add_field($table, $field);
         }
@@ -2863,8 +2864,19 @@ function xmldb_main_upgrade($oldversion) {
     }
 
     if ($oldversion < 2021052500.32) {
-        global $DB, $CFG;
+        // Define field downloadcontent to be added to course.
+        $table = new xmldb_table('course');
+        $field = new xmldb_field('downloadcontent', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'visibleold');
+
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
 
+        // Main savepoint reached.
+        upgrade_main_savepoint(true, 2021052500.32);
+    }
+
+    if ($oldversion < 2021052500.33) {
         $table = new xmldb_table('badge_backpack');
         $uniquekey = new xmldb_key('backpackcredentials', XMLDB_KEY_UNIQUE, ['userid', 'externalbackpackid']);
 
@@ -2900,7 +2912,7 @@ function xmldb_main_upgrade($oldversion) {
         }
 
         // Main savepoint reached.
-        upgrade_main_savepoint(true, 2021052500.32);
+        upgrade_main_savepoint(true, 2021052500.33);
     }
 
     return true;