phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.schema_proc_pgsql.inc.php,1.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.schema_proc_pgsql.inc.php,1.5.2.1,1.5.2.2
Date: Wed, 30 Apr 2003 07:05:53 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv6434

Modified Files:
      Tag: Version-0_9_16-branch
        class.schema_proc_pgsql.inc.php 
Log Message:
fixed schema_proc for pgSql to properly rename a table, if forgot to rename the 
index


Index: class.schema_proc_pgsql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.schema_proc_pgsql.inc.php,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -r1.5.2.1 -r1.5.2.2
*** class.schema_proc_pgsql.inc.php     27 Mar 2003 00:00:39 -0000      1.5.2.1
--- class.schema_proc_pgsql.inc.php     30 Apr 2003 11:05:50 -0000      1.5.2.2
***************
*** 518,524 ****
                                $indexes[] = $val['index_name'];
                        }
!                       if(!in_array($sOldTableName . '_pkey',$indexes))
                        {
                                $oProc->m_odb->query("DROP INDEX " . 
$sOldTableName . "_pkey",__LINE__,__FILE__);
                        }
  
--- 518,528 ----
                                $indexes[] = $val['index_name'];
                        }
!                       if(!in_array($sOldTableName . '_pkey',$indexes))        
// no idea how this can happen
                        {
                                $oProc->m_odb->query("DROP INDEX " . 
$sOldTableName . "_pkey",__LINE__,__FILE__);
+                       }
+                       else    // rename the index
+                       {
+                               $oProc->m_odb->query('ALTER TABLE 
'.$sOldTableName.'_pkey RENAME TO '.$sNewTableName.'_pkey');
                        }
  





reply via email to

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