Skip to content
Snippets Groups Projects
Commit ce083550 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

support old version: drop old table when fields are old

parent ac141265
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment