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

Fix DB upgrade

parent 45b09ff4
No related branches found
No related tags found
No related merge requests found
<?php
function xmldb_block_career_upgrade($oldversion) {
global $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2021070101) {
// Define table block_career_groups to be created.
$table = new xmldb_table('block_career_groups');
// Adding fields to table block_career_groups.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('group_id', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, '0');
$table->add_field('career', XMLDB_TYPE_INTEGER, '8', null, XMLDB_NOTNULL, null, '0');
$table->add_field('timeadded', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
// Adding keys to table block_career_groups.
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
$table->add_key('career', XMLDB_KEY_FOREIGN, ['career'], 'block_career', ['id']);
$table->add_key('group_id', XMLDB_KEY_FOREIGN, ['group_id'], 'groups', ['id']);
// Conditionally launch create table for block_career_groups.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Career savepoint reached.
upgrade_block_savepoint(true, 2021070101, 'career');
}
return true;
}
?>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021062401; $plugin->version = 2021070101;
$plugin->requires = 2014051200; $plugin->requires = 2014051200;
$plugin->component = 'block_career'; $plugin->component = 'block_career';
$plugin->release = 'v1.1'; $plugin->release = 'v1.1';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment