]> git.mjollnir.org Git - moodle.git/commitdiff
Portfolio MDL-20872 adding some extra metadata into the portfolio log table so we...
authorPenny Leach <penny@liip.ch>
Tue, 17 Nov 2009 15:59:26 +0000 (15:59 +0000)
committerPenny Leach <penny@liip.ch>
Tue, 17 Nov 2009 15:59:26 +0000 (15:59 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index 381b5e4a55a348317f9ad5d05b6444a11b88d06e..f7cf812c94302981a3bbbf9587a6eb16176f640d 100644 (file)
         <FIELD NAME="caller_class" TYPE="char" LENGTH="150" NOTNULL="true" SEQUENCE="false" COMMENT="the name of the class used to create the transfer" PREVIOUS="portfolio" NEXT="caller_file"/>
         <FIELD NAME="caller_file" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="path to file to include where the class definition lives. (relative to dirroot)" PREVIOUS="caller_class" NEXT="caller_sha1"/>
         <FIELD NAME="caller_sha1" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="sha1 of exported content as far as the caller is concerned (before the portfolio plugin gets a hold of it)" PREVIOUS="caller_file" NEXT="tempdataid"/>
-        <FIELD NAME="tempdataid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="old id from portfolio_tempdata.  This is so that we can gracefully catch a race condition between an external system requesting a file and causing the tempdata to be deleted, before the user gets the &quot;your transfer is requested&quot; page" PREVIOUS="caller_sha1"/>
+        <FIELD NAME="tempdataid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="old id from portfolio_tempdata.  This is so that we can gracefully catch a race condition between an external system requesting a file and causing the tempdata to be deleted, before the user gets the &quot;your transfer is requested&quot; page" PREVIOUS="caller_sha1" NEXT="returnurl"/>
+        <FIELD NAME="returnurl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="the original &quot;returnurl&quot; of the export - takes us to the moodle page we started from" PREVIOUS="tempdataid" NEXT="continueurl"/>
+        <FIELD NAME="continueurl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="the url the external system has set to view the transfer" PREVIOUS="returnurl"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userfk"/>
index 5aaec6ef035d471256af4bc1b3f6e66ed24084da..341424d4e0768299a0c60b879801456e68ecc0db 100644 (file)
@@ -2796,6 +2796,36 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
         upgrade_main_savepoint($result, 2009111700);
     }
 
+    if ($result && $oldversion < 2009111701) {
+
+    /// Define field returnurl to be added to portfolio_log
+        $table = new xmldb_table('portfolio_log');
+        $field = new xmldb_field('returnurl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'tempdataid');
+
+    /// Conditionally launch add field returnurl
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+    /// Main savepoint reached
+        upgrade_main_savepoint($result, 2009111701);
+    }
+
+    if ($result && $oldversion < 2009111702) {
+
+    /// Define field continueurl to be added to portfolio_log
+        $table = new xmldb_table('portfolio_log');
+        $field = new xmldb_field('continueurl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'returnurl');
+
+    /// Conditionally launch add field continueurl
+        if (!$dbman->field_exists($table, $field)) {
+            $dbman->add_field($table, $field);
+        }
+
+    /// Main savepoint reached
+        upgrade_main_savepoint($result, 2009111702);
+    }
+
 
     return $result;
 }
index af1342b7b7bad6b74685ddfbc9488e0d20045846..7997aaaf31162806d956f3598169983af5b11267 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 = 2009111700;  // YYYYMMDD   = date of the last version bump
+    $version = 2009111702;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20091117)';  // Human-friendly version name