VERS='5.72.074'

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 (
  coefrot	FLOAT,
  dtcfrot	DATE
);

UPDATE gc_art SET
coefrot	=0,
dtcfrot	="01-01-1901"
WHERE coefrot IS NULL;

ALTER TABLE gc_fam ADD (
  coefrot	FLOAT,
  dtcfrot	DATE
);

UPDATE gc_fam SET
coefrot	=0,
dtcfrot	="01-01-1901"
WHERE coefrot IS NULL;

CLOSE DATABASE;

EOT

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

echo "Mise a jour terminee"
