From 1aafee85e08850517ea1a23ba3f6383d510798d2 Mon Sep 17 00:00:00 2001
From: Richard Mansfield <richardm@catalyst.net.nz>
Date: Wed, 12 Aug 2009 12:04:12 +1200
Subject: [PATCH] Allow more space in rpc parent_type column

---
 lib/db/install.xml |    4 ++--
 lib/db/upgrade.php |    8 ++++++++
 version.php        |    2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/db/install.xml b/lib/db/install.xml
index cd2281d..d93fccd 100644
--- a/lib/db/install.xml
+++ b/lib/db/install.xml
@@ -1055,7 +1055,7 @@
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" COMMENT="Unique Function ID" NEXT="function_name"/>
         <FIELD NAME="function_name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="xmlrpc_path"/>
         <FIELD NAME="xmlrpc_path" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="function_name" NEXT="parent_type"/>
-        <FIELD NAME="parent_type" TYPE="char" LENGTH="6" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="xmlrpc_path" NEXT="parent"/>
+        <FIELD NAME="parent_type" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="xmlrpc_path" NEXT="parent"/>
         <FIELD NAME="parent" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="parent_type" NEXT="enabled"/>
         <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent" NEXT="help"/>
         <FIELD NAME="help" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="enabled" NEXT="profile"/>
@@ -1705,4 +1705,4 @@
       </SENTENCES>
     </STATEMENT>
   </STATEMENTS>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index ef6c8ef..ecfa75a 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -3169,6 +3169,14 @@ function xmldb_main_upgrade($oldversion=0) {
         upgrade_main_savepoint($result, 2007101547);
     }
 
+    if ($result && $oldversion < 2007101551) {
+        $table = new XMLDBTable('mnet_rpc');
+        $field = new XMLDBField('parent_type');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, null, null, 'xmlrpc_path');
+        $result = $result && change_field_precision($table, $field);
+        upgrade_main_savepoint($result, 2007101551);
+    }
+
     return $result;
 }
 
diff --git a/version.php b/version.php
index accfafc..3b7d867 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 = 2007101550;  // YYYYMMDD      = date of the 1.9 branch (don't change)
+    $version = 2007101551;  // YYYYMMDD      = date of the 1.9 branch (don't change)
                             //         X     = release number 1.9.[0,1,2,3,4,5...]
                             //          Y.YY = micro-increments between releases
 
-- 
1.5.4.3

