Skip to content

Commit 0b678e2

Browse files
authored
Merge pull request ncstate-delta#565 from ncstate-delta/fix/registration-column-db-settings
db: revert registration upgrade; fix tables that upgraded
2 parents ae444a1 + e07be09 commit 0b678e2

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

db/upgrade.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ function xmldb_zoom_upgrade($oldversion) {
874874
$table = new xmldb_table('zoom');
875875

876876
// Define and conditionally add field registration.
877-
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'option_auto_recording');
877+
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '2', 'option_auto_recording');
878878
if (!$dbman->field_exists($table, $field)) {
879879
$dbman->add_field($table, $field);
880880
}
@@ -933,5 +933,20 @@ function xmldb_zoom_upgrade($oldversion) {
933933
upgrade_mod_savepoint(true, 2023111600, 'zoom');
934934
}
935935

936+
if ($oldversion < 2024012500) {
937+
// Version 5.1.0 incorrectly upgraded the zoom table's registration field. It should not be null and should default to 2.
938+
$table = new xmldb_table('zoom');
939+
$field = new xmldb_field('registration', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '2', 'option_auto_recording');
940+
941+
// Launch change of nullability for field registration.
942+
$dbman->change_field_notnull($table, $field);
943+
944+
// Launch change of default for field registration.
945+
$dbman->change_field_default($table, $field);
946+
947+
// Zoom savepoint reached.
948+
upgrade_mod_savepoint(true, 2024012500, 'zoom');
949+
}
950+
936951
return true;
937952
}

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'mod_zoom';
28-
$plugin->version = 2023121400;
28+
$plugin->version = 2024012500;
2929
$plugin->release = 'v5.1.4';
3030
$plugin->requires = 2019052000;
3131
$plugin->maturity = MATURITY_STABLE;

0 commit comments

Comments
 (0)