From 9e3d48602094cab6dfff542266b5a09d98c87579 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 25 Aug 2021 10:03:07 +1200 Subject: [PATCH] fix some database default inconsistencies. --- db/install.xml | 2 +- db/upgrade.php | 26 ++++++++++++++++++++++++++ version.php | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/db/install.xml b/db/install.xml index 7aba70a..bfba9c2 100755 --- a/db/install.xml +++ b/db/install.xml @@ -74,7 +74,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index 6a9d8ab..cba434a 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -665,5 +665,31 @@ function xmldb_attendance_upgrade($oldversion=0) { upgrade_mod_savepoint(true, 2021082400, 'attendance'); } + if ($oldversion < 2021082401) { + + // Changing the default of field automarkcmid on table attendance_sessions to 0. + $table = new xmldb_table('attendance_sessions'); + $field = new xmldb_field('automarkcmid', XMLDB_TYPE_INTEGER, '10', null, null, null, '0', 'rotateqrcodesecret'); + + // Launch change of default for field automarkcmid. + $dbman->change_field_default($table, $field); + + // Attendance savepoint reached. + upgrade_mod_savepoint(true, 2021082401, 'attendance'); + } + + if ($oldversion < 2021082402) { + + // Changing the default of field ipaddress on table attendance_log to . + $table = new xmldb_table('attendance_log'); + $field = new xmldb_field('ipaddress', XMLDB_TYPE_CHAR, '45', null, null, null, '', 'remarks'); + + // Launch change of default for field ipaddress. + $dbman->change_field_default($table, $field); + + // Attendance savepoint reached. + upgrade_mod_savepoint(true, 2021082402, 'attendance'); + } + return $result; } diff --git a/version.php b/version.php index 599be0e..12bd096 100755 --- a/version.php +++ b/version.php @@ -23,9 +23,9 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021082400; +$plugin->version = 2021082402; $plugin->requires = 2021051700; // Requires 3.11. -$plugin->release = '3.11.7'; +$plugin->release = '3.11.8'; $plugin->maturity = MATURITY_STABLE; $plugin->cron = 0; $plugin->component = 'mod_attendance';