Merge branch 'wip-MDL-44998-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Sam Hemelryk 2014-04-16 09:46:54 +12:00
commit d4449f2f17
3 changed files with 73 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20140320" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
<XMLDB PATH="admin/tool/log/store/standard/db" VERSION="20140415" COMMENT="XMLDB file for Moodle admin/tool/log/store/standard"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../lib/xmldb/xmldb.xsd"
>
@ -33,11 +33,8 @@
</KEYS>
<INDEXES>
<INDEX NAME="timecreated" UNIQUE="false" FIELDS="timecreated"/>
<INDEX NAME="contextid-component" UNIQUE="false" FIELDS="contextid, component"/>
<INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
<INDEX NAME="eventname" UNIQUE="false" FIELDS="eventname"/>
<INDEX NAME="crud" UNIQUE="false" FIELDS="crud"/>
<INDEX NAME="edulevel" UNIQUE="false" FIELDS="edulevel"/>
<INDEX NAME="course-time" UNIQUE="false" FIELDS="courseid, anonymous, timecreated"/>
<INDEX NAME="user-module" UNIQUE="false" FIELDS="userid, contextlevel, contextinstanceid, crud, edulevel, timecreated"/>
</INDEXES>
</TABLE>
</TABLES>

View File

@ -42,5 +42,74 @@ function xmldb_logstore_standard_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2014032000, 'logstore', 'standard');
}
if ($oldversion < 2014041500) {
// Define index contextid-component (not unique) to be dropped form logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('contextid-component', XMLDB_INDEX_NOTUNIQUE, array('contextid', 'component'));
// Conditionally launch drop index contextid-component.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index courseid (not unique) to be dropped form logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('courseid', XMLDB_INDEX_NOTUNIQUE, array('courseid'));
// Conditionally launch drop index courseid.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index eventname (not unique) to be dropped form logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('eventname', XMLDB_INDEX_NOTUNIQUE, array('eventname'));
// Conditionally launch drop index eventname.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index crud (not unique) to be dropped form logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('crud', XMLDB_INDEX_NOTUNIQUE, array('crud'));
// Conditionally launch drop index crud.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index edulevel (not unique) to be dropped form logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('edulevel', XMLDB_INDEX_NOTUNIQUE, array('edulevel'));
// Conditionally launch drop index edulevel.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index course-time (not unique) to be added to logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('course-time', XMLDB_INDEX_NOTUNIQUE, array('courseid', 'anonymous', 'timecreated'));
// Conditionally launch add index course-time.
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Define index user-module (not unique) to be added to logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$index = new xmldb_index('user-module', XMLDB_INDEX_NOTUNIQUE, array('userid', 'contextlevel', 'contextinstanceid', 'crud', 'edulevel', 'timecreated'));
// Conditionally launch add index user-module.
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Standard savepoint reached.
upgrade_plugin_savepoint(true, 2014041500, 'logstore', 'standard');
}
return true;
}

View File

@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014032000; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2014041500; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014031200; // Requires this Moodle version.
$plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).