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

This commit is contained in:
Dan Poltawski
2014-04-08 09:45:07 +08:00
3 changed files with 28 additions and 4 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/forum/db" VERSION="20130710" COMMENT="XMLDB file for Moodle mod/forum"
<XMLDB PATH="mod/forum/db" VERSION="20140404" COMMENT="XMLDB file for Moodle mod/forum"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
@@ -150,7 +150,7 @@
<INDEXES>
<INDEX NAME="userid-forumid" UNIQUE="false" FIELDS="userid, forumid"/>
<INDEX NAME="userid-discussionid" UNIQUE="false" FIELDS="userid, discussionid"/>
<INDEX NAME="userid-postid" UNIQUE="false" FIELDS="userid, postid"/>
<INDEX NAME="postid-userid" UNIQUE="false" FIELDS="postid, userid"/>
</INDEXES>
</TABLE>
<TABLE NAME="forum_track_prefs" COMMENT="Tracks each users untracked forums">
@@ -167,4 +167,4 @@
</INDEXES>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>
+24
View File
@@ -112,5 +112,29 @@ function xmldb_forum_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2014040400) {
// Define index userid-postid (not unique) to be dropped form forum_read.
$table = new xmldb_table('forum_read');
$index = new xmldb_index('userid-postid', XMLDB_INDEX_NOTUNIQUE, array('userid', 'postid'));
// Conditionally launch drop index userid-postid.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}
// Define index postid-userid (not unique) to be added to forum_read.
$index = new xmldb_index('postid-userid', XMLDB_INDEX_NOTUNIQUE, array('postid', 'userid'));
// Conditionally launch add index postid-userid.
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2014040400, 'forum');
}
return true;
}
+1 -1
View File
@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014021700; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2014040400; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2013110500; // Requires this Moodle version
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 60;