From b5fdee1bcb246a753c2d1c37c64e3ab3a8876d3a Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 20 Nov 2014 10:38:11 +1300 Subject: [PATCH] Fix issues with version mis-match and studentscanmark field. --- db/upgrade.php | 24 ++++++++++++------------ version.php | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/db/upgrade.php b/db/upgrade.php index 579f80f..0d51682 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 < 2014022803) { + $table = new xmldb_table('attendance_sessions'); + + $field = new xmldb_field('studentscanmark'); + $field->set_attributes(XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + upgrade_mod_savepoint($result, 2014022803, 'attendance'); + } + return $result; } diff --git a/version.php b/version.php index 2c090d2..4922942 100644 --- a/version.php +++ b/version.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$plugin->version = 2014022802; +$plugin->version = 2014022803; $plugin->requires = 2013111800; $plugin->release = '2.6.2'; $plugin->maturity = MATURITY_STABLE;