Skip to content
Browse files

Merge branch 'w48_MDL-37016_m24_sloppymysql' of https://github.com/sk…

…odak/moodle into MOODLE_24_STABLE
  • Loading branch information...
2 parents 45d9d6d + 7097522 commit 117c147757dcfafafa895e04d48a8fdfae2e57a5 @danpoltawski danpoltawski committed Nov 25, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/db/upgrade.php
View
10 lib/db/upgrade.php
@@ -1293,13 +1293,13 @@ function xmldb_main_upgrade($oldversion) {
}
if ($oldversion < 2012103003.00) {
- // Fix uuid field in event table to match RFC-2445 UID property
+ // Fix uuid field in event table to match RFC-2445 UID property.
$table = new xmldb_table('event');
$field = new xmldb_field('uuid', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'visible');
- if ($dbman->field_exists($table, $field)) {
- // Changing precision of field uuid on table event to (255)
- $dbman->change_field_precision($table, $field);
- }
+ // The column already exists, so make sure there are no nulls (crazy mysql).
+ $DB->set_field_select('event', 'uuid', $DB->sql_empty(), "uuid IS NULL");
+ // Changing precision of field uuid on table event to (255).
+ $dbman->change_field_precision($table, $field);
// Main savepoint reached
upgrade_main_savepoint(true, 2012103003.00);
}

0 comments on commit 117c147

Please sign in to comment.
Something went wrong with that request. Please try again.