Browse Source

Merge pull request #62 from eeisenhart/MOODLE_24-26_STABLE

Fix upgrade process for studentscanmark field.
MOODLE_24-26_STABLE
Dan Marsden 10 years ago
parent
commit
a6eb675cc4
  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