diff --git a/lib/db/install.xml b/lib/db/install.xml index 1a994f74a39..c1130151771 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -754,6 +754,8 @@ + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index b805206224c..58484cee8dd 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -856,5 +856,28 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2023110900.00); } + if ($oldversion < 2023111600.01) { + + // Define index timecreated (not unique) to be added to notifications. + $table = new xmldb_table('notifications'); + $createdindex = new xmldb_index('timecreated', XMLDB_INDEX_NOTUNIQUE, ['timecreated']); + + // Conditionally launch add index timecreated. + if (!$dbman->index_exists($table, $createdindex)) { + $dbman->add_index($table, $createdindex); + } + + // Define index timeread (not unique) to be added to notifications. + $readindex = new xmldb_index('timeread', XMLDB_INDEX_NOTUNIQUE, ['timeread']); + + // Conditionally launch add index timeread. + if (!$dbman->index_exists($table, $readindex)) { + $dbman->add_index($table, $readindex); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2023111600.01); + } + return true; } diff --git a/version.php b/version.php index 2f71a86ceca..8e352642d71 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2023112400.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2023112400.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.4dev (Build: 20231124)'; // Human-friendly version name