MDL-13561 add cmid index to log table to speedup reports that deal with individual activities; merged from MOODLE_19_STABLE
This commit is contained in:
+2
-1
@@ -288,7 +288,8 @@
|
||||
<INDEX NAME="course-module-action" UNIQUE="false" FIELDS="course, module, action" NEXT="time"/>
|
||||
<INDEX NAME="time" UNIQUE="false" FIELDS="time" PREVIOUS="course-module-action" NEXT="action"/>
|
||||
<INDEX NAME="action" UNIQUE="false" FIELDS="action" PREVIOUS="time" NEXT="userid-course"/>
|
||||
<INDEX NAME="userid-course" UNIQUE="false" FIELDS="userid, course" PREVIOUS="action"/>
|
||||
<INDEX NAME="userid-course" UNIQUE="false" FIELDS="userid, course" PREVIOUS="action" NEXT="cmid"/>
|
||||
<INDEX NAME="cmid" UNIQUE="false" FIELDS="cmid" PREVIOUS="userid-course"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="log_display" COMMENT="For a particular module/action, specifies a moodle table/field" PREVIOUS="log" NEXT="message">
|
||||
|
||||
@@ -2857,6 +2857,23 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
upgrade_main_savepoint($result, 2007101508.04);
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2007101508.05) {
|
||||
|
||||
/// Define index cmid (not unique) to be added to log
|
||||
$table = new XMLDBTable('log');
|
||||
$index = new XMLDBIndex('cmid');
|
||||
$index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('cmid'));
|
||||
|
||||
/// Launch add index cmid
|
||||
if (!index_exists($table, $index)) {
|
||||
$result = $result && add_index($table, $index);
|
||||
}
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2007101508.05);
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007101508.04; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
$version = 2007101508.05; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
// X = release number 1.9.[0,1,2,3...]
|
||||
// Y = micro-increments between releases
|
||||
|
||||
|
||||
Reference in New Issue
Block a user