]> git.mjollnir.org Git - moodle.git/commitdiff
Modify some timezone fields to accept new olson files. MDL-12024
authorstronk7 <stronk7>
Sat, 15 Dec 2007 00:49:05 +0000 (00:49 +0000)
committerstronk7 <stronk7>
Sat, 15 Dec 2007 00:49:05 +0000 (00:49 +0000)
Merged from MOODLE_19_STABLE

lib/db/install.xml
lib/db/upgrade.php

index f2553a63a7c8479870588062cd2f661b8f11e154..9aeee707faa918804f40f2f1fef18702211161ef 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20071108" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20071215" COMMENT="XMLDB file for core Moodle tables"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="dst_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_month" NEXT="dst_weekday"/>
         <FIELD NAME="dst_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_startday" NEXT="dst_skipweeks"/>
         <FIELD NAME="dst_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_weekday" NEXT="dst_time"/>
-        <FIELD NAME="dst_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="dst_skipweeks" NEXT="std_month"/>
+        <FIELD NAME="dst_time" TYPE="char" LENGTH="6" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="dst_skipweeks" NEXT="std_month"/>
         <FIELD NAME="std_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_time" NEXT="std_startday"/>
         <FIELD NAME="std_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_month" NEXT="std_weekday"/>
         <FIELD NAME="std_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_startday" NEXT="std_skipweeks"/>
         <FIELD NAME="std_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_weekday" NEXT="std_time"/>
-        <FIELD NAME="std_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="std_skipweeks"/>
+        <FIELD NAME="std_time" TYPE="char" LENGTH="6" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="std_skipweeks"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
       </SENTENCES>
     </STATEMENT>
   </STATEMENTS>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
index 3967a937e22010e5bd3b142c37531e8cdd05dd5b..0c4652b637762cba3ae3cd58ed358987eefa4176 100644 (file)
@@ -2633,6 +2633,28 @@ function xmldb_main_upgrade($oldversion=0) {
         $result = $result && set_field('course', 'format', 'weeks', 'format', 'weekscss');
     }
 
+    if ($result && $oldversion < 2007101505) {
+
+    /// Changing precision of field dst_time on table timezone to (6)
+        $table = new XMLDBTable('timezone');
+        $field = new XMLDBField('dst_time');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '6', null, XMLDB_NOTNULL, null, null, null, '00:00', 'dst_skipweeks');
+
+    /// Launch change of precision for field dst_time
+        $result = $result && change_field_precision($table, $field);
+
+    /// Changing precision of field std_time on table timezone to (6)
+        $table = new XMLDBTable('timezone');
+        $field = new XMLDBField('std_time');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '6', null, XMLDB_NOTNULL, null, null, null, '00:00', 'std_skipweeks');
+
+    /// Launch change of precision for field std_time
+        $result = $result && change_field_precision($table, $field);
+
+    /// Main savepoint reached
+        upgrade_main_savepoint($result, 2007101505);
+    }
+
     return $result;
 }