Permalink
Browse files

MDL-36614 calendar: upgrade code for adding eventtype field to all ex…

…isting installs
  • Loading branch information...
1 parent 35ad5fc commit 20131e5cddd9b070b58e853d0649d40ebe9ac947 @ankitagarwal ankitagarwal committed Nov 19, 2012
Showing with 15 additions and 1 deletion.
  1. +14 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
14 lib/db/upgrade.php
@@ -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
2 version.php
@@ -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

0 comments on commit 20131e5

Please sign in to comment.