mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-61605 quiz report: add missing index/key
Thanks to Patryk Szuta for the suggestion
This commit is contained in:
parent
b63a3b04b1
commit
d9b80a5e69
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<XMLDB PATH="mod/quiz/report/overview/db" VERSION="20120122" COMMENT="XMLDB file for Moodle mod/quiz/report/overview"
|
<XMLDB PATH="mod/quiz/report/overview/db" VERSION="20180319" COMMENT="XMLDB file for Moodle mod/quiz/report/overview"
|
||||||
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"
|
||||||
>
|
>
|
||||||
@ -16,6 +16,7 @@
|
|||||||
</FIELDS>
|
</FIELDS>
|
||||||
<KEYS>
|
<KEYS>
|
||||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||||
|
<KEY NAME="questionusageid-slot" TYPE="foreign-unique" FIELDS="questionusageid, slot" REFTABLE="question_attempts" REFFIELDS="questionusageid, slot"/>
|
||||||
</KEYS>
|
</KEYS>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</TABLES>
|
</TABLES>
|
||||||
|
@ -29,7 +29,9 @@ defined('MOODLE_INTERNAL') || die();
|
|||||||
* @param number $oldversion
|
* @param number $oldversion
|
||||||
*/
|
*/
|
||||||
function xmldb_quiz_overview_upgrade($oldversion) {
|
function xmldb_quiz_overview_upgrade($oldversion) {
|
||||||
global $CFG;
|
global $DB;
|
||||||
|
|
||||||
|
$dbman = $DB->get_manager();
|
||||||
|
|
||||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||||
// Put any upgrade step following this.
|
// Put any upgrade step following this.
|
||||||
@ -40,5 +42,18 @@ function xmldb_quiz_overview_upgrade($oldversion) {
|
|||||||
// Automatically generated Moodle v3.4.0 release upgrade line.
|
// Automatically generated Moodle v3.4.0 release upgrade line.
|
||||||
// Put any upgrade step following this.
|
// Put any upgrade step following this.
|
||||||
|
|
||||||
|
if ($oldversion < 2018021800) {
|
||||||
|
|
||||||
|
// Define key questionusageid-slot (foreign-unique) to be added to quiz_overview_regrades.
|
||||||
|
$table = new xmldb_table('quiz_overview_regrades');
|
||||||
|
$key = new xmldb_key('questionusageid-slot', XMLDB_KEY_FOREIGN_UNIQUE, array('questionusageid', 'slot'), 'question_attempts', array('questionusageid', 'slot'));
|
||||||
|
|
||||||
|
// Launch add key questionusageid-slot.
|
||||||
|
$dbman->add_key($table, $key);
|
||||||
|
|
||||||
|
// Overview savepoint reached.
|
||||||
|
upgrade_plugin_savepoint(true, 2018021800, 'quiz', 'overview');
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,6 @@
|
|||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->version = 2017111300;
|
$plugin->version = 2018021800;
|
||||||
$plugin->requires = 2017110800;
|
$plugin->requires = 2017110800;
|
||||||
$plugin->component = 'quiz_overview';
|
$plugin->component = 'quiz_overview';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user