From: stronk7 Date: Sun, 4 Feb 2007 20:48:34 +0000 (+0000) Subject: Fixing one little-little bug about user->ajax being nullable. MDL-8421 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8dadea8837bde4d3a3deb426fcb0651ce4ef02ac;p=moodle.git Fixing one little-little bug about user->ajax being nullable. MDL-8421 --- diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 0e3c47889e..dbf4847742 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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; } diff --git a/version.php b/version.php index 2a492bff46..e922e252f7 100644 --- a/version.php +++ b/version.php @@ -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