]> git.mjollnir.org Git - moodle.git/commitdiff
Changing nullability of field response on table lesson_answers to null.
authorstronk7 <stronk7>
Wed, 31 Jan 2007 18:40:14 +0000 (18:40 +0000)
committerstronk7 <stronk7>
Wed, 31 Jan 2007 18:40:14 +0000 (18:40 +0000)
Versions in 17_STABLE are the same, so no problems. MDL-8351

Merged from MOODLE_17_STABLE

mod/lesson/db/install.xml
mod/lesson/db/upgrade.php
mod/lesson/version.php

index f19a3573b2fbad4cbf06333b268d3a56537c396d..da6c545b6d1b613438c7a8e27799c141b2683fb0 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/lesson/db" VERSION="20060811" COMMENT="XMLDB file for Moodle mod/lesson">
+<XMLDB PATH="mod/lesson/db" VERSION="20070131" COMMENT="XMLDB file for Moodle mod/lesson"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
   <TABLES>
     <TABLE NAME="lesson" COMMENT="Defines lesson" NEXT="lesson_pages">
       <FIELDS>
@@ -83,7 +86,7 @@
         <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="response" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="answer"/>
+        <FIELD NAME="response" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="answer"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for lesson_answers" NEXT="lessonid"/>
       </SENTENCES>
     </STATEMENT>
   </STATEMENTS>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
index efaf7f151ca10bf4a85aae6721767e86aa6a9428..3de3838d735b47bae5d6fab97d23ecc847bb44ee 100644 (file)
@@ -23,14 +23,15 @@ function xmldb_lesson_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 < 2006091802) {
+
+    /// Changing nullability of field response on table lesson_answers to null
+        $table = new XMLDBTable('lesson_answers');
+        $field = new XMLDBField('response');
+        $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'answer');
+
+    /// Launch change of nullability for field response
+        $result = $result && change_field_notnull($table, $field);
 
     return $result;
 }
index 8041ba59d48fd9d7bd457f90f90c4f37d9577548..1fc5fc29edfe717aab133efd6fc5ee451abac9ee 100644 (file)
@@ -8,7 +8,7 @@
  * @package lesson
  **/
 
-$module->version  = 2006091801;  // The current module version (Date: YYYYMMDDXX)
+$module->version  = 2006091802;  // The current module version (Date: YYYYMMDDXX)
 $module->requires = 2006080900;  // Requires this Moodle version
 $module->cron     = 0;           // Period for cron to check this module (secs)