Make display of user 'extrafields' optional in report. (#294)
[moodle-mod_attendance.git] / db / upgrade.php
index 27e424b..82bdcd9 100644 (file)
@@ -478,5 +478,15 @@ function xmldb_attendance_upgrade($oldversion=0) {
         upgrade_mod_savepoint(true, 2017120801, 'attendance');
     }
 
+    if ($oldversion < 2018022204) {
+        $table = new xmldb_table('attendance');
+        $field = new xmldb_field('showextrauserdetails', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '1', 'subnet');
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+        upgrade_mod_savepoint(true, 2018022204, 'attendance');
+    }
+
+    
     return $result;
 }