diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index b4399f24344..6b17bc295f1 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -522,9 +522,12 @@ class backup_enrolments_structure_step extends backup_structure_step { $enrol = new backup_nested_element('enrol', array('id'), array( 'enrol', 'status', 'sortorder', 'name', 'enrolperiod', 'enrolstartdate', 'enrolenddate', 'expirynotify', 'expirytreshold', 'notifyall', - 'password', 'cost', 'currency', 'roleid', 'customint1', 'customint2', 'customint3', - 'customint4', 'customchar1', 'customchar2', 'customdec1', 'customdec2', - 'customtext1', 'customtext2', 'timecreated', 'timemodified')); + 'password', 'cost', 'currency', 'roleid', + 'customint1', 'customint2', 'customint3', 'customint4', 'customint5', 'customint6', 'customint7', 'customint8', + 'customchar1', 'customchar2', 'customchar3', + 'customdec1', 'customdec2', + 'customtext1', 'customtext2', 'customtext3', 'customtext4', + 'timecreated', 'timemodified')); $userenrolments = new backup_nested_element('user_enrolments'); diff --git a/lib/db/install.xml b/lib/db/install.xml index e54cf890e97..8c01fd2bff4 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -235,14 +235,21 @@ - - - - + + + + + + + + + - - + + + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index d5b98563d2c..58bad7dbaa9 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1119,6 +1119,49 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012081600.01); } + if ($oldversion < 2012082300.01) { + // Add more custom enrol fields. + $table = new xmldb_table('enrol'); + + $field = new xmldb_field('customint5', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint4'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customint6', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint5'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customint7', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint6'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customint8', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'customint7'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customchar3', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'customchar2'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customtext3', XMLDB_TYPE_TEXT, null, null, null, null, null, 'customtext2'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $field = new xmldb_field('customtext4', XMLDB_TYPE_TEXT, null, null, null, null, null, 'customtext3'); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2012082300.01); + } + return true; } diff --git a/version.php b/version.php index 528c92696df..9c9909f1d31 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012082300.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012082300.01; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes