VERS='6.05.001'

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';

UPDATE gc_parsys SET numcert="B17/0097";

alter table cr_signfac MODIFY
  (
    hash char(90)
  );

alter table cr_signlgf MODIFY
  (
    hash char(90)
  );

alter table cr_signgtt MODIFY
  (
    hash char(90)
  );

alter table cr_signaud MODIFY
  (
    hash char(90)
  );

alter table cr_dupfac MODIFY
  (
    hash char(90)
  );

alter table cr_signarch MODIFY
  (
    hash char(90)
  );

CLOSE DATABASE;

EOT

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

echo "Mise a jour $VERS terminee"
