]> git.mjollnir.org Git - moodle.git/commitdiff
Convert DB lang fields to 30cc. Part of MDL-7157
authorstronk7 <stronk7>
Sun, 21 Jan 2007 23:49:23 +0000 (23:49 +0000)
committerstronk7 <stronk7>
Sun, 21 Jan 2007 23:49:23 +0000 (23:49 +0000)
mod/chat/db/install.xml
mod/chat/db/upgrade.php
mod/chat/version.php

index 958bddd6fbc9acb230d989728d9e728acb028c0d..734bde26486f43db70e7d89301d66c99b7babbf0 100644 (file)
@@ -1,5 +1,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>
     <TABLE NAME="chat" COMMENT="Each of these is a chat room" NEXT="chat_messages">
       <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="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="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>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat_users" NEXT="chatid"/>
index 4e9bfdf4b4c59ce806666fc209bb8254a8359137..55fe347678f8f96cef91b31fdf5f467e8493ee74 100644 (file)
@@ -23,14 +23,16 @@ function xmldb_chat_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 < 2007012100) {
+
+    /// Changing precision of field lang on table chat_users to (30)
+        $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;
 }
index 01bbd01f6b926a6aed3c25bc45052f8f4300182a..54a7481f7e85b38f08113c9a92492a24313aebe0 100644 (file)
@@ -5,7 +5,7 @@
 ///  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->cron     = 300;          // How often should cron check this module (seconds)?