From b174e9efa62c779d4d3fe3901ccff62e855c20eb Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 3 Mar 2016 17:27:23 +0800 Subject: [PATCH] MDL-53149 mod_data: add timemodified field to db schema --- mod/data/db/install.xml | 5 +++-- mod/data/db/upgrade.php | 16 ++++++++++++++++ mod/data/version.php | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/mod/data/db/install.xml b/mod/data/db/install.xml index 3eea2463c04..e069bffeaf2 100644 --- a/mod/data/db/install.xml +++ b/mod/data/db/install.xml @@ -1,5 +1,5 @@ - @@ -40,6 +40,7 @@ + @@ -108,4 +109,4 @@ - + \ No newline at end of file diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index bd68fcd5770..7ecf15026c0 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -63,5 +63,21 @@ function xmldb_data_upgrade($oldversion) { // Moodle v3.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2016030300) { + + // Define field timemodified to be added to data. + $table = new xmldb_table('data'); + $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'notification'); + + // Conditionally launch add field timemodified. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Data savepoint reached. + upgrade_mod_savepoint(true, 2016030300, 'data'); + } + + return true; } diff --git a/mod/data/version.php b/mod/data/version.php index 955567dd3d1..001a33cfa07 100644 --- a/mod/data/version.php +++ b/mod/data/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2015111601; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2016030300; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2015111000; // Requires this Moodle version $plugin->component = 'mod_data'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;