From: stronk7 Date: Sun, 21 Jan 2007 23:37:54 +0000 (+0000) Subject: Convert DB lang fields to 30cc. Part of MDL-7157 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=deb12ef4cda3f84f07551c65bb958112e979b816;p=moodle.git Convert DB lang fields to 30cc. Part of MDL-7157 --- diff --git a/group/db/install.xml b/group/db/install.xml index 5ce78667db..f4d5cac482 100644 --- a/group/db/install.xml +++ b/group/db/install.xml @@ -1,5 +1,5 @@ - @@ -10,7 +10,7 @@ - + diff --git a/group/db/upgrade.php b/group/db/upgrade.php index 56e6a919c8..d9dcb25139 100644 --- a/group/db/upgrade.php +++ b/group/db/upgrade.php @@ -230,6 +230,17 @@ function xmldb_group_upgrade($oldversion=0) { $result = $result && change_field_notnull($table, $field); } + if ($result && $oldversion < 2007012100) { + + /// Changing precision of field lang on table groups to (30) + $table = new XMLDBTable('groups'); + $field = new XMLDBField('lang'); + $field->setAttributes(XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, 'en', 'enrolmentkey'); + + /// Launch change of precision for field lang + $result = $result && change_field_precision($table, $field); + } + return $result; } diff --git a/group/version.php b/group/version.php index c202927939..83d23853e2 100644 --- a/group/version.php +++ b/group/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$group_version = 2007012000; +$group_version = 2007012100; //$module->requires = 2006120400; // Requires this Moodle version ?> diff --git a/lib/db/install.xml b/lib/db/install.xml index 8efa822cf3..5f9b4c5ea3 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -56,7 +56,7 @@ - + @@ -544,7 +544,7 @@ - + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 05b3478fd3..fcb39fd66a 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -559,6 +559,25 @@ function xmldb_main_upgrade($oldversion=0) { } } + if ($result && $oldversion < 2007012101) { + + /// Changing precision of field lang on table course to (30) + $table = new XMLDBTable('course'); + $field = new XMLDBField('lang'); + $field->setAttributes(XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, null, 'groupmodeforce'); + + /// Launch change of precision for field course->lang + $result = $result && change_field_precision($table, $field); + + /// Changing precision of field lang on table user to (30) + $table = new XMLDBTable('user'); + $field = new XMLDBField('lang'); + $field->setAttributes(XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null, null, 'en', 'country'); + + /// Launch change of precision for field user->lang + $result = $result && change_field_precision($table, $field); + } + return $result; } diff --git a/version.php b/version.php index 9a57a34724..d5bdd8cc88 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007012100; // YYYYMMDD = date + $version = 2007012101; // YYYYMMDD = date // XY = increments within a single day $release = '1.8 dev'; // Human-friendly version name