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 1b140f49472..c367bf5ffac 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -294,5 +294,17 @@ function xmldb_forum_upgrade($oldversion) { upgrade_mod_savepoint(true, 2019111801, 'forum'); } + if ($oldversion < 2019111802) { + // 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, 2019111802, 'forum'); + } + return true; } diff --git a/mod/forum/version.php b/mod/forum/version.php index 7d1f874ef9e..2b4d2eeaef5 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2019111801; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2019111802; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2019111200; // Requires this Moodle version $plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)