phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/setup tables_update.inc.php,1.53.2.7,1


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/setup tables_update.inc.php,1.53.2.7,1.53.2.8
Date: Fri, 21 Mar 2003 18:51:21 -0500

Update of /cvsroot/phpgroupware/phpgwapi/setup
In directory subversions:/tmp/cvs-serv19779

Modified Files:
      Tag: Version-0_9_14-branch
        tables_update.inc.php 
Log Message:
Fix for bug in update script in 0.9.11.004/5 for pgSql (details see source/diff)



Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/tables_update.inc.php,v
retrieving revision 1.53.2.7
retrieving revision 1.53.2.8
diff -C2 -r1.53.2.7 -r1.53.2.8
*** tables_update.inc.php       21 Mar 2003 15:02:12 -0000      1.53.2.7
--- tables_update.inc.php       21 Mar 2003 23:51:18 -0000      1.53.2.8
***************
*** 455,462 ****
        function phpgwapi_upgrade0_9_14_001()
        {
!               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_config','config_value',array(
!                       'type' => 'text',
!                       'nullable' => False
                ));
                $GLOBALS['phpgw_setup']->oProc->query("UPDATE languages SET 
available='Yes' WHERE lang_id='cs'");
  
--- 455,498 ----
        function phpgwapi_upgrade0_9_14_001()
        {
!               // Fix bug from update script in 0.9.11.004/5:
!               // column config_app was added to table phpgw_config (which 
places it as last column),
!               // but in the tables_current.inc.php it was added as first 
column.
!               // When setup / schemaproc wants to do the AlterColum it 
recreates the table for pgSql,
!               // as pgSql could not change the column-type. This recreation 
is can not be based on 
!               // tables_current, but on running tables_baseline throught all 
update-scripts.
!               // Which gives at the end two different versions of the table 
on new or updated installs.
!               // I fix it now in the (wrong) order of the tables_current, as 
some apps might depend on!
!               
!               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
phpgw_config");
!               while ($GLOBALS['phpgw_setup']->oProc->next_record())
!               {
!                       $confs[] = array(
!                               'config_app' => 
$GLOBALS['phpgw_setup']->oProc->f('config_app'),
!                               'config_name' => 
$GLOBALS['phpgw_setup']->oProc->f('config_name'),
!                               'config_value' => 
$GLOBALS['phpgw_setup']->oProc->f('config_value')
!                       );
!               }
!               $GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_config');
!               
!               
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_config',array(
!                       'fd' => array(
!                               'config_app' => array('type' => 'varchar', 
'precision' => 50),
!                               'config_name' => array('type' => 'varchar', 
'precision' => 255, 'nullable' => false),
!                               'config_value' => array('type' => 'text')
!                       ),
!                       'pk' => array(),
!                       'fk' => array(),
!                       'ix' => array(),
!                       'uc' => array('config_name')
                ));
+               
+               foreach($confs as $conf)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query($q =
+                               "INSERT INTO phpgw_config 
(config_app,config_name,config_value) VALUES ('".
+                               
$conf['config_app']."','".$conf['config_name']."','".$conf['config_value']."')");
+                       echo "$q<br>\n";
+               }
+               
                $GLOBALS['phpgw_setup']->oProc->query("UPDATE languages SET 
available='Yes' WHERE lang_id='cs'");
  





reply via email to

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