Skip to content

Commit

Permalink
Closes #107: Fix cms_type.idnumber database field inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusboon committed Nov 1, 2023
1 parent b510326 commit 4f76674
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,17 @@ function xmldb_cms_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2023082800, 'cms');
}

if ($oldversion < 2023110100) {
// Changing nullability of field idnumber on table cms_types to not null.
$table = new xmldb_table('cms_types');
$field = new xmldb_field('idnumber', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'name');

// Launch change of nullability for field idnumber.
$dbman->change_field_notnull($table, $field);

// Cms savepoint reached.
upgrade_mod_savepoint(true, 2023110100, 'cms');
}

return true;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023100900;
$plugin->version = 2023110100;
$plugin->requires = 2020061500; // Moodle 3.9.0 and above.
$plugin->supported = [39, 401]; // Moodle 3.9 to 4.1 inclusive.
$plugin->component = 'mod_cms';
$plugin->maturity = MATURITY_ALPHA;
$plugin->maturity = MATURITY_STABLE;
$plugin->release = 2023051800;

$plugin->dependencies = [];

0 comments on commit 4f76674

Please sign in to comment.