VERS='5.68.38'

echo "Mise a jour de la base de donnees pour Version $VERS"

isql - - <<EOT

DATABASE gc;

UPDATE 
  gc_parsys 
SET 
  version='$VERS'
WHERE
  version<'$VERS';

ALTER TABLE
  gc_soc
ADD
(
  bddflags7	INTEGER,
  bddflags8	INTEGER,
  bddflags9	INTEGER,
  bddflags10	INTEGER,
  bddflags11	INTEGER
);

UPDATE
  gc_soc
SET
  bddflags7=0,
  bddflags8=0,
  bddflags9=0,
  bddflags10=0,
  bddflags11=0
WHERE
  bddflags7 IS NULL;

ALTER TABLE
  gc_art
ADD
(
  ecotaxe float,
  taxepf  float  
);  

UPDATE
 gc_art
SET
 ecotaxe = 0,
 taxepf  = 0
WHERE
 ecotaxe IS NULL;  

ALTER TABLE
  gc_art
ADD
(
  taxepf1 float,
  taxepf2 float  
);  

UPDATE
 gc_art
SET
 taxepf1 = 0,
 taxepf2 = 0
WHERE
 taxepf1 IS NULL;  

CLOSE DATABASE;

EOT

chmod 666 $DBPATH/gc.dbs/*.idx
chmod 666 $DBPATH/gc.dbs/*.dat

echo "Mise a jour terminee"
