diff --git a/db/install.xml b/db/install.xml index 05f1a4a..88fcf27 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ - @@ -85,6 +85,7 @@ + diff --git a/db/upgrade.php b/db/upgrade.php index 01d2f26..d29d251 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -418,6 +418,20 @@ function xmldb_local_treestudyplan_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2023072000, 'local', 'treestudyplan'); } + if ($oldversion < 2023080300) { + + // Define field span to be added to local_treestudyplan_item. + $table = new xmldb_table('local_treestudyplan_item'); + $field = new xmldb_field('span', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '1', 'continuation_id'); + + // Conditionally launch add field span. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Treestudyplan savepoint reached. + upgrade_plugin_savepoint(true, 2023080300, 'local', 'treestudyplan'); + } return true; diff --git a/version.php b/version.php index 24523cb..3b18440 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 = 2023072801; // YYYYMMDDHH (year, month, day, iteration) +$plugin->version = 2023080300; // YYYYMMDDHH (year, month, day, iteration) $plugin->requires = 2021051700; // YYYYMMDDHH (This is the release version for Moodle 3.11) $plugin->dependencies = [