]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing one little-little bug about user->ajax being nullable. MDL-8421
authorstronk7 <stronk7>
Sun, 4 Feb 2007 20:48:34 +0000 (20:48 +0000)
committerstronk7 <stronk7>
Sun, 4 Feb 2007 20:48:34 +0000 (20:48 +0000)
lib/db/upgrade.php
version.php

index 0e3c47889e894ab11134d0f68216924019f6d0e0..dbf48477422bce19b8477d308101736979dd3d24 100644 (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;
 
 }
index 2a492bff467dae1d83ee770b8be780683a7592a5..e922e252f7057f34bc69f849b9c4a0fa63d5deb6 100644 (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