Convert DB lang fields to 30cc. Part of MDL-7157

This commit is contained in:
stronk7 2007-01-21 23:49:23 +00:00
parent deb12ef4cd
commit 79804e2805
3 changed files with 15 additions and 10 deletions

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/chat/db" VERSION="20060808" COMMENT="XMLDB file for Moodle mod/chat"> <XMLDB PATH="mod/chat/db" VERSION="20070122" COMMENT="XMLDB file for Moodle mod/chat"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES> <TABLES>
<TABLE NAME="chat" COMMENT="Each of these is a chat room" NEXT="chat_messages"> <TABLE NAME="chat" COMMENT="Each of these is a chat room" NEXT="chat_messages">
<FIELDS> <FIELDS>
@ -53,7 +56,7 @@
<FIELD NAME="lastmessageping" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastping" NEXT="sid"/> <FIELD NAME="lastmessageping" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastping" NEXT="sid"/>
<FIELD NAME="sid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastmessageping" NEXT="course"/> <FIELD NAME="sid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastmessageping" NEXT="course"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sid" NEXT="lang"/> <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sid" NEXT="lang"/>
<FIELD NAME="lang" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course"/> <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat_users" NEXT="chatid"/> <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat_users" NEXT="chatid"/>

View file

@ -23,14 +23,16 @@ function xmldb_chat_upgrade($oldversion=0) {
$result = true; $result = true;
/// And upgrade begins here. For each one, you'll need one if ($result && $oldversion < 2007012100) {
/// 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 /// Changing precision of field lang on table chat_users to (30)
/// $result = result of "/lib/ddllib.php" function calls $table = new XMLDBTable('chat_users');
/// } $field = new XMLDBField('lang');
$field->setAttributes(XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, null, 'course');
/// Launch change of precision for field lang
$result = $result && change_field_precision($table, $field);
}
return $result; return $result;
} }

View file

@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php /// This fragment is called by moodle_needs_upgrading() and /admin/index.php
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
$module->version = 2006091800; // The (date) version of this module $module->version = 2007012100; // The (date) version of this module
$module->requires = 2006080900; // Requires this Moodle version $module->requires = 2006080900; // Requires this Moodle version
$module->cron = 300; // How often should cron check this module (seconds)? $module->cron = 300; // How often should cron check this module (seconds)?