Permalink
Browse files

MDL-27635 hub component: fixed default value for 'secret' field in 'r…

…egistration_hubs' table
  • Loading branch information...
1 parent 22e8ad6 commit 4966b0ee715dd213824281910d9566345e2ce9ac Rossiani Wijaya committed Sep 12, 2011
Showing with 16 additions and 3 deletions.
  1. +15 −2 lib/db/upgrade.php
  2. +1 −1 version.php
View
@@ -6051,11 +6051,12 @@ function xmldb_main_upgrade($oldversion) {
// Define field secret to be added to registration_hubs
$table = new xmldb_table('registration_hubs');
$field = new xmldb_field('secret', XMLDB_TYPE_CHAR, '255', null, null, null,
- $CFG->siteidentifier, 'confirmed');
+ null, 'confirmed');
- // Conditionally launch add field secret
+ // Conditionally launch add field secret and set its value
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
+ $DB->set_field('registration_hubs', 'secret', $CFG->siteidentifier);
}
// Main savepoint reached
@@ -6656,6 +6657,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011070101.04);
}
+ if ($oldversion < 2011070101.09) {
+ // Changing the default of field secret on table registration_hubs to NULL
+ $table = new xmldb_table('registration_hubs');
+ $field = new xmldb_field('secret', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'confirmed');
+
+ // Launch change of default for field secret
+ $dbman->change_field_default($table, $field);
+
+ // Main savepoint reached
+ upgrade_main_savepoint(true, 2011070101.09);
+ }
+
return true;
}
View
@@ -31,7 +31,7 @@
-$version = 2011070101.08; // 20110701 = branching date YYYYMMDD - do not modify!
+$version = 2011070101.09; // 20110701 = branching date YYYYMMDD - do not modify!
// RR = release version - do not change in weeklies
// .XX = incremental changes

0 comments on commit 4966b0e

Please sign in to comment.