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

This commit is contained in:
Eloy Lafuente (stronk7) 2014-08-18 20:06:16 +02:00
commit a00678e54b
3 changed files with 19 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/forum/db" VERSION="20140605" COMMENT="XMLDB file for Moodle mod/forum"
<XMLDB PATH="mod/forum/db" VERSION="20140815" COMMENT="XMLDB file for Moodle mod/forum"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
@ -59,6 +59,7 @@
</KEYS>
<INDEXES>
<INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
<INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
</INDEXES>
</TABLE>
<TABLE NAME="forum_posts" COMMENT="All posts are stored in this table">
@ -183,4 +184,4 @@
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
</XMLDB>

View File

@ -185,5 +185,20 @@ function xmldb_forum_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014051202, 'forum');
}
if ($oldversion < 2014081500) {
// Define index course (not unique) to be added to forum_discussions.
$table = new xmldb_table('forum_discussions');
$index = new xmldb_index('course', XMLDB_INDEX_NOTUNIQUE, array('course'));
// Conditionally launch add index course.
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2014081500, 'forum');
}
return true;
}

View File

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014051202; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2014081500; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2014050800; // Requires this Moodle version
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 60;