MDL-86601 core_task: Add index for scheduled task lastruntime
This commit is contained in:
@@ -3501,6 +3501,7 @@
|
||||
</KEYS>
|
||||
<INDEXES>
|
||||
<INDEX NAME="classname_uniq" UNIQUE="true" FIELDS="classname"/>
|
||||
<INDEX NAME="lastruntime_nextruntime" UNIQUE="false" FIELDS="lastruntime, nextruntime"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="task_adhoc" COMMENT="List of adhoc tasks waiting to run.">
|
||||
|
||||
@@ -1684,5 +1684,19 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2026013000.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2026013000.02) {
|
||||
// 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, 2026013000.02);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2026013000.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2026013000.02; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '5.2dev (Build: 20260130)'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user