diff --git a/db/upgrade.php b/db/upgrade.php index 079379f..7d34548 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -201,5 +201,28 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2017111316, 'tool', 'dataprivacy'); } + if ($oldversion < 2017111318) { + + // Define field commentsformat to be added to tool_dataprivacy_request. + $table = new xmldb_table('tool_dataprivacy_request'); + $field = new xmldb_field('commentsformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'comments'); + + // Conditionally launch add field commentsformat. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Define field dpocommentformat to be added to tool_dataprivacy_request. + $field = new xmldb_field('dpocommentformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'dpocomment'); + + // Conditionally launch add field dpocommentformat. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Dataprivacy savepoint reached. + upgrade_plugin_savepoint(true, 2017111318, 'tool', 'dataprivacy'); + } + return true; } diff --git a/version.php b/version.php index 39ec7cd..371f117 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2017111317; +$plugin->version = 2017111318; $plugin->requires = 2017111304.00; // Moodle 3.4.4 (Build: 20180517) and upwards. $plugin->component = 'tool_dataprivacy'; $plugin->release = '34.8.0';