VERS='5.72.092'

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_art
ADD (
  txtgap1	FLOAT,
  txtgap2	FLOAT
);

UPDATE gc_art SET 
prom = 0
WHERE prom IS NULL;

UPDATE gc_art SET 
txtgap1=0, txtgap2=0
WHERE txtgap1 IS NULL;

ALTER TABLE gc_erc
ADD (
  dtentstk	DATE
);

UPDATE gc_erc SET
dtentstk=datereel
WHERE dtentstk IS NULL;

CLOSE DATABASE;

EOT

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

echo "Mise a jour terminee"
