mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-48108 core: Add new indexes to message tables
This commit is contained in:
parent
b5e9faa67e
commit
8b52863f0a
6
lib/db/install.xml
Normal file → Executable file
6
lib/db/install.xml
Normal file → Executable file
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="lib/db" VERSION="20150211" COMMENT="XMLDB file for core Moodle tables"
|
||||
<XMLDB PATH="lib/db" VERSION="20150219" COMMENT="XMLDB file for core Moodle tables"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -541,6 +541,7 @@
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom"/>
|
||||
<INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto"/>
|
||||
<INDEX NAME="useridfromto" UNIQUE="false" FIELDS="useridfrom, useridto"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="message_read" COMMENT="Stores all messages that have been read">
|
||||
@ -565,6 +566,7 @@
|
||||
<INDEXES>
|
||||
<INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom"/>
|
||||
<INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto"/>
|
||||
<INDEX NAME="useridfromto" UNIQUE="false" FIELDS="useridfrom, useridto"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="message_contacts" COMMENT="Maintains lists of relationships between users">
|
||||
@ -3096,4 +3098,4 @@
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
</XMLDB>
|
||||
</XMLDB>
|
@ -4177,5 +4177,29 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2015021100.00);
|
||||
}
|
||||
|
||||
if ($oldversion < 2015021900.00) {
|
||||
|
||||
// Define index useridfromto (not unique) to be added to message.
|
||||
$table = new xmldb_table('message');
|
||||
$index = new xmldb_index('useridfromto', XMLDB_INDEX_NOTUNIQUE, array('useridfrom', 'useridto'));
|
||||
|
||||
// Conditionally launch add index useridfromto.
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
// Define index useridfromto (not unique) to be added to message_read.
|
||||
$table = new xmldb_table('message_read');
|
||||
$index = new xmldb_index('useridfromto', XMLDB_INDEX_NOTUNIQUE, array('useridfrom', 'useridto'));
|
||||
|
||||
// Conditionally launch add index useridfromto.
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2015021900.00);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2015021900.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2015022400.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user