diff --git a/db/install.xml b/db/install.xml index 600cd93..aa806c6 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,7 +1,7 @@ - @@ -13,9 +13,8 @@ - + - @@ -23,4 +22,3 @@
- diff --git a/db/upgrade.php b/db/upgrade.php new file mode 100644 index 0000000..d8a5b7d --- /dev/null +++ b/db/upgrade.php @@ -0,0 +1,51 @@ +. + +/** + * Upgrade steps. + * + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * + * @package moodle-tool_groupautoenrol + * @copyright 04/04/2024 Mfreak.nl | LdesignMedia.nl - Luuk Verhoeven + * @author Luuk Verhoeven + **/ + +/** + * xmldb_tool_groupautoenrol_upgrade + * + * @param $oldversion + * @return true + */ +function xmldb_tool_groupautoenrol_upgrade($oldversion) { + + global $DB; + $dbman = $DB->get_manager(); + + if ($oldversion < 2024040400) { + + // Changing type of field groupslist on table tool_groupautoenrol to text. + $table = new xmldb_table('tool_groupautoenrol'); + $field = new xmldb_field('groupslist', XMLDB_TYPE_TEXT, null, null, null, null, null, 'use_groupslist'); + + // Launch change of type for field groupslist. + $dbman->change_field_type($table, $field); + + // Groupautoenrol savepoint reached. + upgrade_plugin_savepoint(true, 2024040400, 'tool', 'groupautoenrol'); + } + return true; +}