message MDL-24771 moved the upgrade code

This commit is contained in:
Andrew Davis
2010-10-26 08:45:51 +00:00
parent 2ec48e8484
commit 018f4f996d
2 changed files with 22 additions and 22 deletions
+21 -21
View File
@@ -5317,27 +5317,6 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
upgrade_main_savepoint(true, 2010102300);
}
//MDL-24771
if ($oldversion < 2010102600) {
$fieldnotification = new xmldb_field('notification', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'smallmessage');
$fieldcontexturl = new xmldb_field('contexturl', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'notification');
$fieldcontexturlname = new xmldb_field('contexturlname', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'contexturl');
$fieldstoadd = array($fieldnotification, $fieldcontexturl, $fieldcontexturlname);
$tablestomodify = array(new xmldb_table('message'), new xmldb_table('message_read'));
foreach($tablestomodify as $table) {
foreach($fieldstoadd as $field) {
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
}
}
upgrade_main_savepoint(true, 2010102600);
}
// MDL-24694 needs increasing size of user_preferences.name(varchar[50]) field due to
// long preferences names for messaging which need components parts within the name
// eg: 'message_provider_mod_assignment_assignments_loggedin'
@@ -5367,6 +5346,27 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
upgrade_main_savepoint(true, 2010102600);
}
//MDL-24771
if ($oldversion < 2010102601) {
$fieldnotification = new xmldb_field('notification', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'smallmessage');
$fieldcontexturl = new xmldb_field('contexturl', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'notification');
$fieldcontexturlname = new xmldb_field('contexturlname', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'contexturl');
$fieldstoadd = array($fieldnotification, $fieldcontexturl, $fieldcontexturlname);
$tablestomodify = array(new xmldb_table('message'), new xmldb_table('message_read'));
foreach($tablestomodify as $table) {
foreach($fieldstoadd as $field) {
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
}
}
upgrade_main_savepoint(true, 2010102601);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2010102600; // YYYYMMDD = date of the last version bump
$version = 2010102601; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 RC1 (Build: 20101026)'; // Human-friendly version name