From 0c40c58f08d95eae1ade412c9e4ec7f2b0e7701a Mon Sep 17 00:00:00 2001 From: kristian-94 <37063983+kristian-94@users.noreply.github.com> Date: Mon, 3 Aug 2020 11:27:29 +1000 Subject: [PATCH] Add caleventid index to attendance_sessions table #484 (#487) --- db/upgrade.php | 12 ++++++++++++ version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/db/upgrade.php b/db/upgrade.php index 7131823..f86843c 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -628,5 +628,17 @@ function xmldb_attendance_upgrade($oldversion=0) { } + if ($oldversion < 2020072900) { + $table = new xmldb_table('attendance_sessions'); + + // Conditionally launch add index caleventid. + $index = new xmldb_index('caleventid', XMLDB_INDEX_NOTUNIQUE, array('caleventid')); + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + // Attendance savepoint reached. + upgrade_mod_savepoint(true, 2020072900, 'attendance'); + } + return $result; } diff --git a/version.php b/version.php index a38c246..0e81a31 100755 --- a/version.php +++ b/version.php @@ -23,7 +23,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2020071700; +$plugin->version = 2020072900; $plugin->requires = 2019072500; // Requires 3.8. $plugin->release = '3.8.3'; $plugin->maturity = MATURITY_STABLE;