diff --git a/lib/db/install.xml b/lib/db/install.xml index a35a832e9e7..51edcd67aba 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -1918,6 +1918,7 @@ + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 2d14a0ea5f6..43cbaa688f4 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2921,5 +2921,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2021100600.03); } + if ($oldversion < 2021100600.04) { + // Define index itemtype-mod-inst-course (not unique) to be added to grade_items. + $table = new xmldb_table('grade_items'); + $index = new xmldb_index('itemtype-mod-inst-course', XMLDB_INDEX_NOTUNIQUE, + ['itemtype', 'itemmodule', 'iteminstance', 'courseid']); + + // Conditionally launch add index itemtype-mod-inst-course. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2021100600.04); + } + return true; } diff --git a/version.php b/version.php index 79617dfcc15..94c0299344f 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2021100600.03; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2021100600.04; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.0dev+ (Build: 20211006)'; // Human-friendly version name