diff --git a/db/upgrade.php b/db/upgrade.php new file mode 100644 index 0000000..17335e3 --- /dev/null +++ b/db/upgrade.php @@ -0,0 +1,49 @@ +. + +/** + * Capability definitions for the driprelease + * + * @package tool_driprelease + * @copyright 2022 Marcus Green + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Upgrade code for tool_driprelease. + * @param int $oldversion the version we are upgrading from. + */ +function xmldb_tool_driprelease_upgrade($oldversion = 0) { + global $DB; + + $dbman = $DB->get_manager(); + if ($oldversion < 2023100300) { + + // Define field coursegroup to be added to tool_driprelease. + $table = new xmldb_table('tool_driprelease'); + $field = new xmldb_field('coursegroup', XMLDB_TYPE_CHAR, '50', null, null, null, null, 'sessionlength'); + + // Conditionally launch add field coursegroup. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Driprelease savepoint reached. + upgrade_plugin_savepoint(true, 2023100300, 'tool', 'driprelease'); + } + + return true; +} \ No newline at end of file diff --git a/version.php b/version.php index 4234125..a05fde1 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'tool_driprelease'; -$plugin->release = '0.2.0'; -$plugin->version = 2023021600; +$plugin->release = '1.5.0'; +$plugin->version = 2023100300; $plugin->requires = 2020110900; $plugin->maturity = MATURITY_BETA;