diff --git a/db/install.xml b/db/install.xml index 41bebef..98af795 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ - @@ -62,7 +62,6 @@ - diff --git a/db/upgrade.php b/db/upgrade.php index 6fd4769..c3293cd 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -455,5 +455,25 @@ function xmldb_local_treestudyplan_upgrade($oldversion) { // Treestudyplan savepoint reached. upgrade_plugin_savepoint(true, 2023080900, 'local', 'treestudyplan'); } + + if ($oldversion < 2023082100) { + + // Up to version 20230821 the studyplan_id field still existed in the install.xml file + // Below code remedies that - even though this is a repeat of part of an earlier upgrade + + // Define field studyplan_id to be dropped from local_treestudyplan_line. + $table = new xmldb_table('local_treestudyplan_line'); + $field = new xmldb_field('studyplan_id'); + + // Conditionally launch drop field studyplan_id. + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + // Treestudyplan savepoint reached. + upgrade_plugin_savepoint(true, 2023082100, 'local', 'treestudyplan'); + } + + return true; } \ No newline at end of file diff --git a/version.php b/version.php index e498010..35e47c5 100644 --- a/version.php +++ b/version.php @@ -1,6 +1,6 @@ component = 'local_treestudyplan'; // Recommended since 2.0.2 (MDL-26035). Required since 3.0 (MDL-48494) -$plugin->version = 2023081800; // YYYYMMDDHH (year, month, day, iteration) +$plugin->version = 2023082100; // YYYYMMDDHH (year, month, day, iteration) $plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11) $plugin->dependencies = [