From 4cf1a211087d394569f11679af03f2a0991a05e2 Mon Sep 17 00:00:00 2001 From: Eric Eisenhart Date: Fri, 14 Nov 2014 11:28:04 -0800 Subject: [PATCH] Fix upgrade process for studentscanmark field. --- db/upgrade.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/db/upgrade.php b/db/upgrade.php index 579f80f..c71facc 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -34,18 +34,6 @@ function xmldb_attendance_upgrade($oldversion=0) { $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) { // Replace values that reference old module "attforblock" to "attendance". $sql = "UPDATE {grade_items} @@ -85,5 +73,17 @@ function xmldb_attendance_upgrade($oldversion=0) { 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; }