]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9506 Changed grade_calculations.usermodified type to null from non-null.
authornicolasconnault <nicolasconnault>
Thu, 26 Apr 2007 05:40:35 +0000 (05:40 +0000)
committernicolasconnault <nicolasconnault>
Thu, 26 Apr 2007 05:40:35 +0000 (05:40 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index dec9959b3d8b5f823caa380e0c6b9e2b8ee6557d..2d238b9dac0da62872dd6fb9bc6b006b12651e32 100644 (file)
         <FIELD NAME="expireref" TYPE="char" LENGTH="250" NOTNULL="false" DEFAULT="" SEQUENCE="false" ENUM="false" PREVIOUS="expiry" NEXT="created"/>
         <FIELD NAME="created" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="expireref" NEXT="modified"/>
         <FIELD NAME="modified" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="created" NEXT="sessdata"/>
-        <FIELD NAME="sessdata" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="modified"/>
+        <FIELD NAME="sessdata" TYPE="text" LENGTH="big" NOTNULL="false" DEFAULT="" SEQUENCE="false" ENUM="false" PREVIOUS="modified"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="sesskey" COMMENT="Primary key for sessions"/>
         <FIELD NAME="calculation" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Formula describing how to derive this grade from other items, referring to them using [idnumber] ... eg something like:sin(square([XXXXX])) + [YYYY]" PREVIOUS="itemid" NEXT="timecreated"/>
         <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this calculation was first created" PREVIOUS="calculation" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this calculation was last modified" PREVIOUS="timecreated" NEXT="usermodified"/>
-        <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the userid of the person who last modified this calculation" PREVIOUS="timemodified"/>
+        <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the userid of the person who last modified this calculation" PREVIOUS="timemodified"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="itemid"/>
index 88cf92b33925e2dce36079dd4bb5a1d1d94dd21f..d94197eedb1581e6bb9fb5f31715979bda7f36ad 100644 (file)
@@ -1019,6 +1019,16 @@ function xmldb_main_upgrade($oldversion=0) {
         $result = $result && add_field($table, $field);
     }
     
+    if ($result && $oldversion < 2007042601) {
+
+    /// Changing nullability of field usermodified on table grade_calculations to null
+        $table = new XMLDBTable('grade_calculations');
+        $field = new XMLDBField('usermodified');
+        $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'timemodified');
+
+        /// Launch change of nullability for field usermodified
+        $result = $result && change_field_notnull($table, $field);
+    }
     return $result;
 
 }
index d2c5a718d83ac7e8c7b016348954d2c731bd494d..aa3f3f92e06a108cd8bd9df1495f019d16e3a6fa 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 = 2007042600;  // YYYYMMDD = date
+   $version = 2007042601;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.9 dev';    // Human-friendly version name