fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10514] api: handling definition on nullable


From: Sigurd Nes
Subject: [Fmsystem-commits] [10514] api: handling definition on nullable
Date: Mon, 19 Nov 2012 12:02:12 +0000

Revision: 10514
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10514
Author:   sigurdne
Date:     2012-11-19 12:01:53 +0000 (Mon, 19 Nov 2012)
Log Message:
-----------
api: handling definition on nullable

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.custom_fields.inc.php
    trunk/phpgwapi/inc/class.schema_proc.inc.php

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-11-19 10:24:21 UTC 
(rev 10513)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2012-11-19 12:01:53 UTC 
(rev 10514)
@@ -732,7 +732,8 @@
                        $OldColumnName          = $this->_db->f('column_name');
                        $OldDataType            = $this->_db->f('datatype');
                        $OldPrecision           = $this->_db->f('precision_');
-                       $OldGroup                       = (int) 
$this->_db->f('group_id');                      
+                       $OldGroup                       = (int) 
$this->_db->f('group_id');
+                       $OldNullable            = $this->_db->f('nullable');    
        
 
                        $this->_db->transaction_begin();
 
@@ -818,7 +819,9 @@
                        }
 
                        if (($OldDataType != $attrib['column_info']['type'])
-                               || ($OldPrecision != 
$attrib['column_info']['precision']) )
+                               || ($OldPrecision != 
$attrib['column_info']['precision'])
+                               || ($OldNullable != 
$attrib['column_info']['nullable'])
+                                )
                        {
                                if( !$doubled )
                                {
@@ -911,6 +914,7 @@
                                                while 
(isset($metadata[$backup_column_name]));
                                                
                                                
$this->_oProc->RenameColumn($attrib_table,$attrib['column_name'], 
$backup_column_name);
+                                               
$this->_oProc->AlterColumn($attrib_table,$backup_column_name,array('type' => 
$OldDataType, 'nullable' => true));
                                                
$this->_oProc->AddColumn($attrib_table, $attrib['column_name'], 
$attrib['column_info']);
                                        }
                                        

Modified: trunk/phpgwapi/inc/class.schema_proc.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc.inc.php        2012-11-19 10:24:21 UTC 
(rev 10513)
+++ trunk/phpgwapi/inc/class.schema_proc.inc.php        2012-11-19 12:01:53 UTC 
(rev 10514)
@@ -490,7 +490,7 @@
                        $sBufDefault = '';
                        if($sFieldSQL = 
$this->m_oTranslator->TranslateType($sType, $iPrecision, $iScale))
                        {
-                               if($bNullable == False)
+                               if($bNullable == False || $bNullable == 'False')
                                {
                                        $sBufNullable = ' NOT NULL';
                                        //$sFieldSQL .= ' NOT NULL';




reply via email to

[Prev in Thread] Current Thread [Next in Thread]