diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 0aeee7f6fc2..c241541f201 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -157,7 +157,22 @@ function xmldb_forum_upgrade($oldversion) { upgrade_mod_savepoint(true, 2014051201, 'forum'); } - if ($oldversion < 2014051202) { + 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'); + } + + if ($oldversion < 2014081900) { // Define table forum_discussion_subs to be created. $table = new xmldb_table('forum_discussion_subs'); @@ -182,22 +197,7 @@ function xmldb_forum_upgrade($oldversion) { } // Forum savepoint reached. - 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'); + upgrade_mod_savepoint(true, 2014081900, 'forum'); } return true; diff --git a/mod/forum/version.php b/mod/forum/version.php index f6d07e00003..12037b71783 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2014081500; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2014081900; // 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;