MDL-70781 course: setting for displaying completion conditions
[moodle.git] / lib / db / upgrade.php
index 998e94e..69c232a 100644 (file)
@@ -2535,5 +2535,19 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2021033100.00);
     }
 
+    if ($oldversion < 2021033100.01) {
+        // Define field 'showcompletionconditions' to be added to course.
+        $table = new xmldb_table('course');
+        $field = new xmldb_field('showcompletionconditions', XMLDB_TYPE_INTEGER, '1', null,
+            XMLDB_NOTNULL, null, '1', 'completionnotify');
+
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+        // Main savepoint reached.
+        upgrade_main_savepoint(true, 2021033100.01);
+    }
+
     return true;
 }