]> git.mjollnir.org Git - moodle.git/commitdiff
Changing course->shortname to 100c under all DBs. Part of MDL-10026
authorstronk7 <stronk7>
Wed, 8 Aug 2007 09:06:09 +0000 (09:06 +0000)
committerstronk7 <stronk7>
Wed, 8 Aug 2007 09:06:09 +0000 (09:06 +0000)
lib/db/upgrade.php

index 928ee62df520dab1fc07ced293163fc2106c9271..eff9fa55a259b3b56150a94040ebb2e6c9e573d3 100644 (file)
@@ -1623,6 +1623,17 @@ function xmldb_main_upgrade($oldversion=0) {
         }
     }
 
+    if ($result && $oldversion < 2007080800) { /// Normalize course->shortname MDL-10026
+
+    /// Changing precision of field shortname on table course to (100)
+        $table = new XMLDBTable('course');
+        $field = new XMLDBField('shortname');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, null, null, 'fullname');
+
+    /// Launch change of precision for field shortname
+        $result = $result && change_field_precision($table, $field);
+    }
+
 /*
     /// drop old gradebook tables
     if ($result && $oldversion < 2007072209) {