/[phpcompta]/phpcompta/html/admin/setup.php
ViewVC logotype

Diff of /phpcompta/html/admin/setup.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31 by sparkyx, Wed Sep 28 10:09:31 2005 UTC revision 1.32 by sparkyx, Wed Sep 28 15:07:48 2005 UTC
# Line 311  for ($e=0;$e < $MaxDossier;$e++) { Line 311  for ($e=0;$e < $MaxDossier;$e++) {
311      ExecuteScript($db,'sql/patch/upgrade7.sql');      ExecuteScript($db,'sql/patch/upgrade7.sql');
312      // now we use sequence instead of computing a max      // now we use sequence instead of computing a max
313      //      //
314      $Res=ExecSql($db,'select max(jr_grpt_id) as L from jrn');      $Res2=ExecSql($db,'select coalesce(max(jr_grpt_id),1) as l from jrn');
315      if ( pg_NumRows($Res) == 1) {      $Max2= pg_NumRows($Res2) ;
316        $Row=pg_fetch_array($Res,0);      if ( $Max2 == 1) {
317        $Max=$Row['L'];        $Row=pg_fetch_array($Res2,0);
318        $Res=ExecSql($db,"select setval('s_grpt',$Max,true)");        var_dump($Row);
319          $M=$Row['l'];
320          ExecSql($db,"select setval('s_grpt',$M,true)");
321      }      }
322    } // version == 6    } // version == 7
323    
324   }   }
325    
# Line 344  for ($e=0;$e < $MaxDossier;$e++) { Line 346  for ($e=0;$e < $MaxDossier;$e++) {
346      ExecuteScript($db,'sql/patch/upgrade5.sql');      ExecuteScript($db,'sql/patch/upgrade5.sql');
347    } // version == 5    } // version == 5
348    
349    
350      //--
351      // update to the version 7
352      //--
353      if ( GetVersion($db) == 6 ) {
354        ExecuteScript($db,'sql/patch/upgrade6.sql');
355      } // version == 6
356    
357      //--
358      // update to the version 8
359      //--
360      if ( GetVersion($db) == 7 ) {
361        ExecuteScript($db,'sql/patch/upgrade7.sql');
362        // now we use sequence instead of computing a max
363        //
364        $Res2=ExecSql($db,'select coalesce(max(jr_grpt_id),1) as l from jrn');
365        $Max2= pg_NumRows($Res2) ;
366        if ( $Max2 == 1) {
367          $Row=pg_fetch_array($Res2,0);
368          $M=$Row['l'];
369          ExecSql($db,"select setval('s_grpt',$M,true)");
370        }
371      } // version == 7
372    
373   }   }
374  $cn=DbConnect();  $cn=DbConnect();
375  if ( GetVersion($cn) <= 4 ) {  if ( GetVersion($cn) <= 4 ) {

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26