MDL-71438 blocks: Add index on mdl_user_preferences.name
This commit is contained in:
@@ -909,6 +909,7 @@
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="userid-name" UNIQUE="true" FIELDS="userid, name"/>
|
||||
<INDEX NAME="name" UNIQUE="false" FIELDS="name"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="user_lastaccess" COMMENT="To keep track of course page access times, used in online participants block, and participants list">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user