diff --git a/db/upgrade.php b/db/upgrade.php index 839aa766ca11f966a5444e929bf60a66474ac1fa..4a50d0dd2bc9dcb984f1a3d029d5de019bff3f11 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -7,7 +7,7 @@ function xmldb_block_competency_iena_upgrade($oldversion) { $dbman = $DB->get_manager(); $result = TRUE; - if ($oldversion < 2021070600) { + if ($oldversion < 2021240901) { // Define field id to be added to block_competency_iena. $table = new xmldb_table('block_competency_iena'); @@ -23,6 +23,10 @@ function xmldb_block_competency_iena_upgrade($oldversion) { if (!$dbman->table_exists($table)) { $dbman->create_table($table); } + else if(!$dbman->field_exists('block_competency_iena', 'cmid')){ + $dbman->drop_table($table); + $dbman->create_table($table); + } //Support for old versions: we copy the already linked activities to the new database try { @@ -46,7 +50,7 @@ function xmldb_block_competency_iena_upgrade($oldversion) { } // Competency_iena savepoint reached. - upgrade_block_savepoint(true, 2021070600, 'competency_iena'); + upgrade_block_savepoint(true, 2021240901, 'competency_iena'); } return $result; diff --git a/version.php b/version.php index b312025506ffebc3950fea82d65617cbf0048a7f..a04a79799a5ba71a5e56f8a74f097dcf87786b1c 100644 --- a/version.php +++ b/version.php @@ -28,7 +28,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021240900; +$plugin->version = 2021240901; $plugin->requires = 2014051200; $plugin->component = 'block_competency_iena'; $plugin->release = 'v1.0';