Changing nullability of field response on table lesson_answers to null.

Versions in 17_STABLE are the same, so no problems. MDL-8351

Merged from MOODLE_17_STABLE
This commit is contained in:
stronk7 2007-01-31 18:40:14 +00:00
parent 9d17f1d331
commit 8a88bce5ac
3 changed files with 15 additions and 11 deletions

View 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"/>
@ -231,4 +234,4 @@
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</XMLDB>
</XMLDB>

View 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 < 2006091802) {
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
/// 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;
}

View 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)