Fixing one little-little bug about user->ajax being nullable. MDL-8421

This commit is contained in:
stronk7
2007-02-04 20:48:34 +00:00
parent b7a0ea8781
commit 8dadea8837
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -593,6 +593,19 @@ function xmldb_main_upgrade($oldversion=0) {
execute_sql("DELETE FROM {$CFG->prefix}user WHERE username='changeme'", true);
}
if ($result && $oldversion < 2007020400) {
/// Only for MySQL and PG, declare the user->ajax field as not null. MDL-8421.
if ($CFG->dbfamily == 'mysql' || $CFG->dbfamily == 'postgres') {
/// Changing nullability of field ajax on table user to not null
$table = new XMLDBTable('user');
$field = new XMLDBField('ajax');
$field->setAttributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '1', 'htmleditor');
/// Launch change of nullability for field ajax
$result = $result && change_field_notnull($table, $field);
}
}
return $result;
}
+1 -1
View File
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2007020200; // YYYYMMDD = date
$version = 2007020400; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.8 Beta'; // Human-friendly version name