diff --git a/db/install.xml b/db/install.xml
index 6291f86..38050b1 100755
--- a/db/install.xml
+++ b/db/install.xml
@@ -91,6 +91,7 @@
+
diff --git a/db/upgrade.php b/db/upgrade.php
index 01022ad..415bdc6 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -30,5 +30,23 @@
* @return bool
*/
function xmldb_dialogue_upgrade($oldversion) {
+ global $DB;
+
+ $dbman = $DB->get_manager();
+
+ if ($oldversion < 2024120900) {
+ // Define index dialogueid (not unique) to be added to dialogue_messages.
+ $table = new xmldb_table('dialogue_messages');
+ $index = new xmldb_index('dialogueid', XMLDB_INDEX_NOTUNIQUE, ['dialogueid']);
+
+ // Conditionally launch add index userid.
+ if (!$dbman->index_exists($table, $index)) {
+ $dbman->add_index($table, $index);
+ }
+
+ // savepoint reached.
+ upgrade_mod_savepoint(true, 2024120900, 'dialogue');
+ }
+
return true;
}
diff --git a/version.php b/version.php
index 063cade..dbbe610 100644
--- a/version.php
+++ b/version.php
@@ -23,8 +23,8 @@
*/
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2024100901;
-$plugin->release = 2024100901;
+$plugin->version = 2024120900;
+$plugin->release = 2024120900;
$plugin->requires = 2022112805; // Requires 4.1 or higher.
$plugin->component = 'mod_dialogue'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE; // This version's maturity level.