<?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>
<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
$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;
}
* @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)