]> git.mjollnir.org Git - moodle.git/commitdiff
adding timemodified to tag_instance table (to get blog blocks working)
authortoyomoyo <toyomoyo>
Mon, 27 Aug 2007 04:21:59 +0000 (04:21 +0000)
committertoyomoyo <toyomoyo>
Mon, 27 Aug 2007 04:21:59 +0000 (04:21 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index d1d10a032f1d62c3d576a7c0c403af75dde64564..e5f5066be0027ae8fbbccb620fc1817d4c6b9725 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20070823" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20070827" COMMENT="XMLDB file for core Moodle tables"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="tagid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="itemtype"/>
         <FIELD NAME="itemtype" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="tagid" NEXT="itemid"/>
         <FIELD NAME="itemid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="itemtype" NEXT="ordering"/>
-        <FIELD NAME="ordering" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="Maintains the order of the tag instances of an item" PREVIOUS="itemid"/>
+        <FIELD NAME="ordering" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="Maintains the order of the tag instances of an item" PREVIOUS="itemid" NEXT="timemodified"/>
+        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="timemodified" PREVIOUS="ordering"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for tag_instance"/>
index 7723e5c192b422c0a7489aa19a52f438971f8b8e..98ace3166ac2dbbb3c95e5167e5f1ab99293e8dd 100644 (file)
@@ -1779,6 +1779,17 @@ function xmldb_main_upgrade($oldversion=0) {
     }
 */
 
+    if ($result && $oldversion < 2007082700) {
+
+    /// Define field timemodified to be added to tag_instance
+        $table = new XMLDBTable('tag_instance');
+        $field = new XMLDBField('timemodified');
+        $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'ordering');
+
+    /// Launch add field timemodified
+        $result = $result && add_field($table, $field);
+    }
+
     return $result;
 }
 
index 6b7289056719add8d66768267cc6e36319a06da4..3bd8b3d405c351e9a35a67d541e0c87f7473f615 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 = 2007082400;  // YYYYMMDD = date
+    $version = 2007082700;  // YYYYMMDD = date
                             //       XY = increments within a single day
 
     $release = '1.9 Beta +';   // Human-friendly version name