]> git.mjollnir.org Git - moodle.git/commitdiff
Merging fix for MDL-8637
authormark-nielsen <mark-nielsen>
Fri, 23 Feb 2007 17:31:05 +0000 (17:31 +0000)
committermark-nielsen <mark-nielsen>
Fri, 23 Feb 2007 17:31:05 +0000 (17:31 +0000)
mod/lesson/db/install.xml
mod/lesson/db/upgrade.php
mod/lesson/version.php

index aff81154b45bddca0e8970d903386fdb2abdc30d..94f74bee080e145adb3e7420dcd0f362a89d2aa3 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/lesson/db" VERSION="20070201" COMMENT="XMLDB file for Moodle mod/lesson"
+<XMLDB PATH="mod/lesson/db" VERSION="20070223" COMMENT="XMLDB file for Moodle mod/lesson"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
 >
@@ -85,7 +85,7 @@
         <FIELD NAME="flags" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="score" NEXT="timecreated"/>
         <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="flags" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="answer"/>
-        <FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="response"/>
+        <FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="response"/>
         <FIELD NAME="response" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="answer"/>
       </FIELDS>
       <KEYS>
index c24bfeeaaf7af902e94283a76a9eb83f5c978320..85798a6d481aa393d88b3705b3147fa152586302 100644 (file)
@@ -45,6 +45,17 @@ function xmldb_lesson_upgrade($oldversion=0) {
         $result = $result && change_field_notnull($table, $field);
     }
 
+    if ($result && $oldversion < 2007020201) {
+
+    /// Changing nullability of field answer on table lesson_answers to null
+        $table = new XMLDBTable('lesson_answers');
+        $field = new XMLDBField('answer');
+        $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'timemodified');
+
+    /// Launch change of nullability for field answer
+        $result = $result && change_field_notnull($table, $field);
+    }
+
     return $result;
 }
 
index b959249aaa8b6dae37da6d842b623c28e3883523..d27a3cb72bffe0460f53852e8778acf02a372009 100644 (file)
@@ -8,7 +8,7 @@
  * @package lesson
  **/
 
-$module->version  = 2007020200;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2007020201;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2007020200;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)