diff --git a/lib/db/install.xml b/lib/db/install.xml index 87a8826c2fd..3ea22b7e4e8 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -909,6 +909,7 @@ + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index dcd3c5a8cfa..d071e7e71a2 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3059,5 +3059,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2020110903.05); } + if ($oldversion < 2020110904.05) { + + // Define index name (not unique) to be added to user_preferences. + $table = new xmldb_table('user_preferences'); + $index = new xmldb_index('name', XMLDB_INDEX_NOTUNIQUE, ['name']); + + // Conditionally launch add index name. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2020110904.05); + } + return true; } diff --git a/lib/upgrade.txt b/lib/upgrade.txt index ebd4aeaec3e..f0815bdbb81 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -6,6 +6,7 @@ information provided here is intended especially for developers. has been extended. The new parameter allows the to get the name without escaped characters. * The signature of the question_category_options() has been extended. The new parameter allows the to get the categories name in the returned array without escaped characters. +* A new index has been added on mdl_user_preferences.name. This upgrade step might take some time on big sites. === 3.10.3 === * The behat transformation 'string time to timestamp' no longer supports datetime format. If provided, the format must diff --git a/version.php b/version.php index 50cb993c05d..65c96c75048 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2020110904.04; // 20201109 = branching date YYYYMMDD - do not modify! +$version = 2020110904.05; // 20201109 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '3.10.4+ (Build: 20210527)';// Human-friendly version name