MDL-36614 calendar: upgrade code for adding eventtype field to all existing installs

This commit is contained in:
Ankit Agarwal 2012-11-19 13:17:24 +08:00
parent 35ad5fc6bb
commit 20131e5cdd
2 changed files with 15 additions and 1 deletions

View File

@ -1472,6 +1472,20 @@ function xmldb_main_upgrade($oldversion) {
// Main savepoint reached.
upgrade_main_savepoint(true, 2012111200.01);
}
if ($oldversion < 2012111601.01) {
// Define field eventtype to be added to event_subscriptions.
$table = new xmldb_table('event_subscriptions');
$field = new xmldb_field('eventtype', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, 'userid');
// Conditionally launch add field eventtype.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2012111601.01);
}
return true;

View File

@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2012111601.00; // YYYYMMDD = weekly release date of this DEV branch
$version = 2012111601.01; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes