VERS='5.71.039'

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_typalc ADD (
  tximp0	FLOAT,
  txcalc0	SMALLINT,
  tximp1	FLOAT,
  txcalc1	SMALLINT,
  tximp2	FLOAT,
  txcalc2	SMALLINT,
  tximp3	FLOAT,
  txcalc3	SMALLINT
);

UPDATE gc_typalc SET
  tximp0	=0,
  txcalc0	=0,
  tximp1	=0,
  txcalc1	=0,
  tximp2	=0,
  txcalc2	=0,
  tximp3	=0,
  txcalc3	=0
WHERE tximp0 IS NULL;

EOT

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

echo "Mise a jour terminee"
