troodle-expcontent/db/upgrade.php

33 lines
995 B
PHP
Raw Permalink Normal View History

<?php
defined('MOODLE_INTERNAL') || die();
function xmldb_exp360_upgrade($oldversion) {
global $DB;
$dbman = $DB->get_manager();
if ($oldversion < 2024070503) {
// Define field intro to be added to exp360.
$table = new xmldb_table('exp360');
$field = new xmldb_field('intro', XMLDB_TYPE_TEXT, null, null, null, null, null, 'name');
// Conditionally launch add field intro.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Define field introformat to be added to exp360.
$field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'intro');
// Conditionally launch add field introformat.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Exp360 savepoint reached.
upgrade_mod_savepoint(true, 2024070503, 'exp360');
}
return true;
}