Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Upgrade step for format columns
Browse files Browse the repository at this point in the history
Add missing upgrade step for the following columns:
* commentsformat
* dpocommentformat
  • Loading branch information
junpataleta committed Jun 16, 2020
1 parent c1b7785 commit 86fa46f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 86fa46f

Please sign in to comment.