]> git.mjollnir.org Git - moodle.git/commitdiff
Add missing fields when upgrading/installing on Postgres
authorfmarier <fmarier>
Fri, 9 Nov 2007 01:25:28 +0000 (01:25 +0000)
committerfmarier <fmarier>
Fri, 9 Nov 2007 01:25:28 +0000 (01:25 +0000)
mod/exercise, mod/scorm and question/type/rqp
MDL-12023

mod/exercise/db/postgres7.php
mod/exercise/db/upgrade.php
mod/exercise/version.php
mod/scorm/db/upgrade.php
mod/scorm/version.php

index d77f49b8cee8af3487a7d6cb75b56ee7ac318f1b..a78c6e88d4a4f3283eced051d95863eb56f62b6a 100644 (file)
@@ -11,10 +11,6 @@ function exercise_upgrade($oldversion) {
 
     global $CFG;
 
-    if ($oldversion < 2003121000) {
-        execute_sql(" ALTER TABLE `{$CFG->prefix}exercise_submissions` ADD `late` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
-    }
-
     if ($oldversion < 2004062300) {
         table_column("exercise", "", "gradinggrade", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "grade");
         table_column("exercise", "", "assessmentcomps", "INTEGER", "4", "UNSIGNED", "2", "NOT NULL", "usemaximum");
index 066a8dc0e5e0ffcab122acd9cf4e4603e6a977de..6ad8536dfed451b589310afbbca3e555cc2b9209 100644 (file)
@@ -23,14 +23,12 @@ function xmldb_exercise_upgrade($oldversion=0) {
 
     $result = true;
 
-/// And upgrade begins here. For each one, you'll need one 
-/// block of code similar to the next one. Please, delete 
-/// this comment lines once this file start handling proper
-/// upgrade code.
-
-/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
-///     $result = result of "/lib/ddllib.php" function calls
-/// }
+    if ($result && $oldversion < 2007110500) {
+        $table = new XMLDBTable('exercise_submissions');
+        $field = new XMLDBField('late');
+        $field->setAttributes(XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, 0, 'isexercise');
+        $result = $result && add_field($table, $field);
+    }
 
     return $result;
 }
index 112eb509862b480d526ae9ae7da546d93051494a..a3bf19423f1c6cf2f82089ac789e7f9e336f860c 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2007020200;
+$module->version  = 2007110500;
 $module->requires = 2007101000;  // Requires this Moodle version
 $module->cron     = 60;
 
index a8c11c5ff791140067753ac361e00d80227c72ee..73c0145260a9723563390953794afde865701055 100644 (file)
@@ -282,6 +282,15 @@ function xmldb_scorm_upgrade($oldversion=0) {
         $db->debug = true;
     }  
 
+       // Adding missing 'version' field to table scorm
+    if ($result && $oldversion < 2007110500) {
+        $table = new XMLDBTable('scorm');
+        $field = new XMLDBField('version');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '9', null, XMLDB_NOTNULL, null, null, null, 'scorm_12', 'summary');
+
+        $result = $result && add_field($table, $field);
+    }
+
     return $result;
 }
 
index 405411ed1863c7a0952c2cc9e1ebc814ba1daea7..9f7d46d31b5229609d41a79d1a2ce24a83548f1b 100755 (executable)
@@ -10,7 +10,7 @@
 //       catch up now, so until 27th October please only increment in very tiny steps 
 //       in HEAD, until we get past that date..
 
-$module->version  = 2007081001;   // The (date) version of this module
+$module->version  = 2007110500;   // The (date) version of this module
 $module->requires = 2007101000;   // The version of Moodle that is required
 $module->cron     = 300;            // How often should cron check this module (seconds)?