diff --git a/lib/db/install.xml b/lib/db/install.xml index b3fea5c3a98..27c2663ac6f 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -3498,6 +3498,7 @@ + @@ -3523,6 +3524,7 @@ +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index d36a746273b..e7fe6cc7d10 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1952,5 +1952,33 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2025041404.06); } + if ($oldversion < 2025041404.08) { + // Define index nextruntime_classname (not unique) to be added to task_adhoc. + $table = new xmldb_table('task_adhoc'); + $index = new xmldb_index('nextruntime_classname', XMLDB_INDEX_NOTUNIQUE, ['nextruntime', 'classname']); + + // Conditionally launch add index nextruntime_classname. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2025041404.08); + } + + if ($oldversion < 2025041404.09) { + // Define index lastruntime_nextruntime (not unique) to be added to task_scheduled. + $table = new xmldb_table('task_scheduled'); + $index = new xmldb_index('lastruntime_nextruntime', XMLDB_INDEX_NOTUNIQUE, ['lastruntime', 'nextruntime']); + + // Conditionally launch add index lastruntime_nextruntime. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2025041404.09); + } + return true; }