From e63b6b8665972a2342fb5f77361c1944873adfa1 Mon Sep 17 00:00:00 2001 From: Peter Burnett Date: Tue, 7 Jul 2020 15:17:08 +1000 Subject: [PATCH] MDL-69170 task: Added timecreated field to adhoc task table --- lib/classes/task/manager.php | 1 + lib/db/install.xml | 3 ++- lib/db/upgrade.php | 15 +++++++++++++++ version.php | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index 7bf811b9c2f..552cd49eeb1 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -275,6 +275,7 @@ class manager { $record->faildelay = $task->get_fail_delay(); $record->customdata = $task->get_custom_data_as_string(); $record->userid = $task->get_userid(); + $record->timecreated = time(); return $record; } diff --git a/lib/db/install.xml b/lib/db/install.xml index 0e0c4f0d49d..e50236eeb86 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -3370,6 +3370,7 @@ + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index a61f5e9a388..9e43105b67a 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2539,5 +2539,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2020072300.01); } + if ($oldversion < 2020073000.01) { + + // Define field timecreated to be added to task_adhoc. + $table = new xmldb_table('task_adhoc'); + $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'blocking'); + + // Conditionally launch add field timecreated. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2020073000.01); + } + return true; } diff --git a/version.php b/version.php index 5ea5e1f2a3c..7e9b1e0a597 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2020073000.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2020073000.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.0dev (Build: 20200730)'; // Human-friendly version name