mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-53296_master tool_lp: Add unique index in course_competency
This commit is contained in:
parent
d61035968d
commit
b986597039
3 changed files with 15 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<XMLDB PATH="admin/tool/lp/db" VERSION="20160304" COMMENT="XMLDB file for Moodle admin/tool/lp"
|
<XMLDB PATH="admin/tool/lp/db" VERSION="20160305" COMMENT="XMLDB file for Moodle admin/tool/lp"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
|
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
|
||||||
>
|
>
|
||||||
|
@ -73,6 +73,7 @@
|
||||||
</KEYS>
|
</KEYS>
|
||||||
<INDEXES>
|
<INDEXES>
|
||||||
<INDEX NAME="courseidruleoutcome" UNIQUE="false" FIELDS="courseid, ruleoutcome"/>
|
<INDEX NAME="courseidruleoutcome" UNIQUE="false" FIELDS="courseid, ruleoutcome"/>
|
||||||
|
<INDEX NAME="courseidcompetencyid" UNIQUE="true" FIELDS="courseid, competencyid"/>
|
||||||
</INDEXES>
|
</INDEXES>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
<TABLE NAME="tool_lp_plan" COMMENT="Learning plans">
|
<TABLE NAME="tool_lp_plan" COMMENT="Learning plans">
|
||||||
|
|
|
@ -820,5 +820,17 @@ function xmldb_tool_lp_upgrade($oldversion) {
|
||||||
upgrade_plugin_savepoint(true, 2016020913, 'tool', 'lp');
|
upgrade_plugin_savepoint(true, 2016020913, 'tool', 'lp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2016020917) {
|
||||||
|
// Define index courseidcompetencyid (unique) to be added to tool_lp_course_competency.
|
||||||
|
$table = new xmldb_table('tool_lp_course_competency');
|
||||||
|
$index = new xmldb_index('courseidcompetencyid', XMLDB_INDEX_UNIQUE, array('courseid', 'competencyid'));
|
||||||
|
// Conditionally launch add index cmidcompetencyid.
|
||||||
|
if (!$dbman->index_exists($table, $index)) {
|
||||||
|
$dbman->add_index($table, $index);
|
||||||
|
}
|
||||||
|
// Lp savepoint reached.
|
||||||
|
upgrade_plugin_savepoint(true, 2016020917, 'tool', 'lp');
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
|
||||||
$plugin->version = 2016020916; // The current plugin version (Date: YYYYMMDDXX).
|
$plugin->version = 2016020917; // The current plugin version (Date: YYYYMMDDXX).
|
||||||
$plugin->requires = 2014110400; // Requires this Moodle version.
|
$plugin->requires = 2014110400; // Requires this Moodle version.
|
||||||
$plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).
|
$plugin->component = 'tool_lp'; // Full name of the plugin (used for diagnostics).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue