diff --git a/mod/forum/db/install.xml b/mod/forum/db/install.xml index ef7545dce73..bbda97aba99 100644 --- a/mod/forum/db/install.xml +++ b/mod/forum/db/install.xml @@ -1,5 +1,5 @@ - @@ -99,6 +99,7 @@ + diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 7d36e0413b4..5f709bd6bfa 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -246,5 +246,17 @@ function xmldb_forum_upgrade($oldversion) { // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2020072100) { + // Add index privatereplyto (not unique) to the forum_posts table. + $table = new xmldb_table('forum_posts'); + $index = new xmldb_index('privatereplyto', XMLDB_INDEX_NOTUNIQUE, ['privatereplyto']); + + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + upgrade_mod_savepoint(true, 2020072100, 'forum'); + } + return true; } diff --git a/mod/forum/version.php b/mod/forum/version.php index 7eddcd86571..11f48d60362 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2020061500; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2020072100; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2020060900; // Requires this Moodle version $plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)