Skip to content

Commit

Permalink
MDL-20534 lti: A2, cleanup upgrade and moodle1 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 authored and scriby committed Nov 7, 2011
1 parent ea04a9f commit fccacaa
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions mod/lti/db/upgrade.php
Expand Up @@ -46,9 +46,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die;

/**
* xmldb_lti_upgrade is the function that upgrades Moodle's
* database when is needed
* xmldb_lti_upgrade is the function that upgrades
* the lti module database when is needed
*
* This function is automaticly called when version number in
* version.php changes.
Expand All @@ -57,41 +59,11 @@
*
* @return boolean
*/
function xmldb_lti_upgrade($oldversion=0) {
global $DB;
function xmldb_lti_upgrade($oldversion) {
global $CFG, $DB;

$dbman = $DB->get_manager();

if ($oldversion < 2011100701) {
$table = new xmldb_table('lti');
$field = new xmldb_field('icon', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'servicesalt');

if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

upgrade_mod_savepoint(true, 2011100701, 'lti');
}

if ($oldversion < 2011101801) {
$table = new xmldb_table('lti');
$field = new xmldb_field('securetoolurl', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'toolurl');

if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

$field = new xmldb_field('secureicon', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'icon');

if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

upgrade_mod_savepoint(true, 2011101801, 'lti');
}

$result = true;

return $result;
return true;
}

0 comments on commit fccacaa

Please sign in to comment.