Browse Source

Fix upgrade process for studentscanmark field.

MOODLE_24-26_STABLE
Eric Eisenhart 10 years ago
parent
commit
4cf1a21108
  1. 24
      db/upgrade.php

24
db/upgrade.php

@ -34,18 +34,6 @@ function xmldb_attendance_upgrade($oldversion=0) {
$result = true; $result = true;
if ($oldversion < 2013082901) {
$table = new xmldb_table('attendance_sessions');
$field = new xmldb_field('studentscanmark');
$field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_mod_savepoint($result, 2013082901, 'attendance');
}
if ($oldversion < 2013082902) { if ($oldversion < 2013082902) {
// Replace values that reference old module "attforblock" to "attendance". // Replace values that reference old module "attforblock" to "attendance".
$sql = "UPDATE {grade_items} $sql = "UPDATE {grade_items}
@ -85,5 +73,17 @@ function xmldb_attendance_upgrade($oldversion=0) {
upgrade_plugin_savepoint($result, 2013082902, 'mod', 'attendance'); upgrade_plugin_savepoint($result, 2013082902, 'mod', 'attendance');
} }
if ($oldversion < 2014022802) {
$table = new xmldb_table('attendance_sessions');
$field = new xmldb_field('studentscanmark');
$field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_mod_savepoint($result, 2014022802, 'attendance');
}
return $result; return $result;
} }

Loading…
Cancel
Save