]> git.mjollnir.org Git - moodle.git/commitdiff
Merged fix for MDL-8390 from MOODLE_17_STABLE branch
authormark-nielsen <mark-nielsen>
Fri, 2 Feb 2007 03:45:02 +0000 (03:45 +0000)
committermark-nielsen <mark-nielsen>
Fri, 2 Feb 2007 03:45:02 +0000 (03:45 +0000)
mod/lesson/db/install.xml
mod/lesson/db/upgrade.php
mod/lesson/version.php

index da6c545b6d1b613438c7a8e27799c141b2683fb0..aff81154b45bddca0e8970d903386fdb2abdc30d 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/lesson/db" VERSION="20070131" COMMENT="XMLDB file for Moodle mod/lesson"
+<XMLDB PATH="mod/lesson/db" VERSION="20070201" COMMENT="XMLDB file for Moodle mod/lesson"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="answerid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="retry"/>
         <FIELD NAME="retry" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="answerid" NEXT="correct"/>
         <FIELD NAME="correct" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="retry" NEXT="useranswer"/>
-        <FIELD NAME="useranswer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="correct" NEXT="timeseen"/>
+        <FIELD NAME="useranswer" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="correct" NEXT="timeseen"/>
         <FIELD NAME="timeseen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useranswer"/>
       </FIELDS>
       <KEYS>
index 0c75364e9afa0983732c3be87c0de761f0c2b410..c24bfeeaaf7af902e94283a76a9eb83f5c978320 100644 (file)
@@ -34,6 +34,17 @@ function xmldb_lesson_upgrade($oldversion=0) {
         $result = $result && change_field_notnull($table, $field);
     }
 
+    if ($result && $oldversion < 2006091803) {
+
+    /// Changing nullability of field useranswer on table lesson_attempts to null
+        $table = new XMLDBTable('lesson_attempts');
+        $field = new XMLDBField('useranswer');
+        $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'correct');
+
+    /// Launch change of nullability for field useranswer
+        $result = $result && change_field_notnull($table, $field);
+    }
+
     return $result;
 }
 
index 1fc5fc29edfe717aab133efd6fc5ee451abac9ee..8dd81323e2396138f654efeb338543db8ec80293 100644 (file)
@@ -8,7 +8,7 @@
  * @package lesson
  **/
 
-$module->version  = 2006091802;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2006091803;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2006080900;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)