MDL-81000 core: increase size of "attemptsavailable" on task_adhoc table

This commit is contained in:
raortegar 2024-03-20 09:24:10 +01:00
parent c895def59b
commit 27a2e4969c
3 changed files with 19 additions and 4 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20240129" COMMENT="XMLDB file for core Moodle tables"
<XMLDB PATH="lib/db" VERSION="20240326" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@ -3509,7 +3509,7 @@
<FIELD NAME="timestarted" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="Time when the task was started"/>
<FIELD NAME="hostname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Hostname where the task is running"/>
<FIELD NAME="pid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="PHP process ID that is running the task"/>
<FIELD NAME="attemptsavailable" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false" COMMENT="The remaining attempts for this task"/>
<FIELD NAME="attemptsavailable" TYPE="int" LENGTH="2" NOTNULL="false" SEQUENCE="false" COMMENT="The remaining attempts for this task"/>
<FIELD NAME="firststartingtime" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="The start time of the first run of the task"/>
</FIELDS>
<KEYS>

View file

@ -870,7 +870,7 @@ function xmldb_main_upgrade($oldversion) {
$field = new xmldb_field(
name: 'attemptsavailable',
type: XMLDB_TYPE_INTEGER,
precision: '1',
precision: '2',
unsigned: null,
notnull: null,
sequence: null,
@ -1129,5 +1129,20 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2024030500.02);
}
if ($oldversion < 2024032600.01) {
// Changing precision of field attemptsavailable on table task_adhoc to (2).
$table = new xmldb_table('task_adhoc');
$field = new xmldb_field('attemptsavailable', XMLDB_TYPE_INTEGER, '2', null, null, null, null, 'pid');
// Launch change of precision for field.
if (!$dbman->field_exists($table, $field)) {
$dbman->change_field_precision($table, $field);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2024032600.01);
}
return true;
}

View file

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2024032600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2024032600.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.4dev+ (Build: 20240326)'; // Human-friendly version name