Skip to content

Commit

Permalink
Merge branch 'wip-MDL-26811-m21' of git://github.com/samhemelryk/mood…
Browse files Browse the repository at this point in the history
…le into MOODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Sep 5, 2011
2 parents 5f856fd + ed9041c commit 26cfc10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/db/upgrade.php
Expand Up @@ -1230,8 +1230,14 @@ function xmldb_main_upgrade($oldversion) {
$field = new xmldb_field('backuptype', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null, 'info');
/// Conditionally Launch add field backuptype and set all old records as 'scheduledbackup' records.
if (!$dbman->field_exists($table, $field)) {
// Set the default we want applied to any existing records
$field->setDefault('scheduledbackup');
// Add the field to the database
$dbman->add_field($table, $field);
$DB->execute("UPDATE {backup_log} SET backuptype='scheduledbackup'");
// Remove the default
$field->setDefault(null);
// Update the database to remove the default
$dbman->change_field_default($table, $field);
}

/// Main savepoint reached
Expand Down

0 comments on commit 26cfc10

Please sign in to comment.