set explicit lenght for index
authorFilip Visic <visicfilip@gmail.com>
Sat, 1 Jun 2013 00:45:44 +0000 (02:45 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Jun 2013 11:19:44 +0000 (13:19 +0200)
Change-Id: Ieb0c2e902e9e165a417f92489c1f77ed62821178
Reviewed-on: https://gerrit.tine20.org/tine20/2079
Tested-by: jenkins user
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Backend/Oracle.php
tine20/Setup/Backend/Schema/Index/Abstract.php
tine20/Setup/Backend/Schema/Index/Xml.php

index 7ece646..75ee690 100644 (file)
@@ -598,6 +598,10 @@ class Setup_Backend_Oracle extends Setup_Backend_Abstract
             if (!empty($keyfield->length)) {
                 $key .= ' (' . $keyfield->length . ')';
             }
+            // added
+            else if (array_key_exists((string)$keyfield, $_key->fieldLength)) {
+                $key .= ' (' . $_key->fieldLength[(string)$keyfield] . ')';
+            }
             $keys[] = $key;
         }
 
index 4a7bb50..16676a6 100644 (file)
@@ -18,6 +18,13 @@ abstract class Setup_Backend_Schema_Index_Abstract extends Setup_Backend_Schema_
      * @var array
      */
     public $field = array();
+    
+    /**
+     * length for fields
+     * 
+     * @var array
+     */
+    public $fieldLength = array();
 
     /**
      * index defines primary key
index eb7f8dd..3fd30af 100644 (file)
@@ -33,6 +33,10 @@ class Setup_Backend_Schema_Index_Xml extends Setup_Backend_Schema_Index_Abstract
             } else if ($key == 'field') {
                 if ($val instanceof SimpleXMLElement) {
                     $this->field[] = (string) $val->name;
+                    
+                    if (isset($val->length)) {
+                        $this->fieldLength[(string) $val->name] = (int) $val->length;
+                    }
                 } else {
                     $this->field   = (string) $val;
                 }