]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9506 Removed childrentype after discussion with Martin D.
authornicolasconnault <nicolasconnault>
Thu, 3 May 2007 05:44:33 +0000 (05:44 +0000)
committernicolasconnault <nicolasconnault>
Thu, 3 May 2007 05:44:33 +0000 (05:44 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index 2df209577a55318db709be755e6cf113455355f7..c89d025d0687584fda6d67a8fe240abea07e16a8 100644 (file)
       <FIELDS>
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="courseid"/>
         <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The course this grade category is part of" PREVIOUS="id" NEXT="parent"/>
-        <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="Categories can be hierarchical" PREVIOUS="courseid" NEXT="childrentype"/>
-        <FIELD NAME="childrentype" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="0=grade_items, 1=grade_categories" PREVIOUS="parent" NEXT="depth"/>
-        <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="How many parents does this category have?" PREVIOUS="childrentype" NEXT="path"/>
+        <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="Categories can be hierarchical" PREVIOUS="courseid" NEXT="depth"/>
+        <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="How many parents does this category have?" PREVIOUS="parent" NEXT="path"/>
         <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="shows the path as /1/2/3 (like course_categories)" PREVIOUS="depth" NEXT="fullname"/>
         <FIELD NAME="fullname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The name of this grade category" PREVIOUS="path" NEXT="aggregation"/>
         <FIELD NAME="aggregation" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)" PREVIOUS="fullname" NEXT="keephigh"/>
index fe07f9935ead41ecd21efcc1d0cd78f22d790a98..be0a781cc4901c65614b9fa42bc7820babe3f79c 100644 (file)
@@ -1161,7 +1161,16 @@ function xmldb_main_upgrade($oldversion=0) {
     // Launch add field childrentype
         $result = $result && add_field($table, $field);
     }
+    if ($result && $oldversion < 2007050301) {
+
+    /// Define field parent to be dropped from grade_categories
+        $table = new XMLDBTable('grade_categories');
+        $field = new XMLDBField('childrentype');
     
+    /// Launch drop field parent
+        $result = $result && drop_field($table, $field);
+    }
+
     return $result; 
 }
 
index 8d308f0349d458a1c1c8cd34431801d11414ccdd..f601d2020232bc0b0d6d498de07cc4a58ff4d6f3 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 = 2007050300;  // YYYYMMDD = date
+   $version = 2007050301;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.9 dev';    // Human-friendly version name