Skip to content

Commit

Permalink
db: revert registration upgrade; fix tables that upgraded
Browse files Browse the repository at this point in the history
The registration field definition was unintentionally changed. Some users upgraded after that change and have the wrong database column settings. After upgrading again, those users will have the correct column settings.
  • Loading branch information
jrchamp authored Jan 18, 2024
1 parent 54313db commit 72169d0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ function xmldb_zoom_upgrade($oldversion) {
$table = new xmldb_table('zoom');

// Define and conditionally add field registration.
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'option_auto_recording');
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '2', 'option_auto_recording');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
Expand Down Expand Up @@ -933,5 +933,19 @@ function xmldb_zoom_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2023111600, 'zoom');
}

if ($oldversion < 2024012700) {
$table = new xmldb_table('zoom');
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '2', 'option_auto_recording');

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

// Launch change of default for field registration.
$dbman->change_field_default($table, $field);

// Zoom savepoint reached.
upgrade_mod_savepoint(true, 2024012700, 'zoom');
}

return true;
}

0 comments on commit 72169d0

Please sign in to comment.