MDL-53051 tool_lp: Index cmid+competencyid to tool_lp_module_competency
This commit is contained in:
committed by
Frederic Massart
parent
d32d64bcbc
commit
74c9942f5c
@@ -298,6 +298,7 @@
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="cmidruleoutcome" UNIQUE="false" FIELDS="cmid, ruleoutcome" COMMENT="Index on cmid and outcome so we can quickly find what to do when an activity is completed."/>
|
||||
<INDEX NAME="cmidcompetencyid" UNIQUE="false" FIELDS="cmid, competencyid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
|
||||
@@ -728,5 +728,20 @@ function xmldb_tool_lp_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2016020901, 'tool', 'lp');
|
||||
}
|
||||
|
||||
if ($oldversion < 2016020902) {
|
||||
|
||||
// Define index cmidcompetencyid to be added to tool_lp_module_competency.
|
||||
$table = new xmldb_table('tool_lp_module_competency');
|
||||
$index = new xmldb_index('cmidcompetencyid', XMLDB_INDEX_NOTUNIQUE, array('cmid', 'competencyid'));
|
||||
|
||||
// Conditionally launch add index cmidcompetencyid.
|
||||
if (!$dbman->index_exists($table, $index)) {
|
||||
$dbman->add_index($table, $index);
|
||||
}
|
||||
|
||||
// Lp savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2016020902, 'tool', 'lp');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user