VERS='5.72.114'

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

DROP TABLE logevent;

CREATE TABLE logevent 
  (
    numsoc smallint,
    numdep smallint,
    gdh_d date,
    gdh_h integer,
    session integer,
    username char(10),
    numutil smallint,
    func integer,
    ref1 char(80),
    ref2 char(5),
    ref3 char(5),
    ref4 char(5),
    ref5 char(5),
    action char(80),
    champ char(5),
    ancval char(60),
    newval char(60),
    comment char(180),
    nseek serial
  );

CREATE INDEX ix_logevent01 ON logevent (numsoc,gdh_d,gdh_h,nseek);

CLOSE DATABASE;

EOT

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

echo "Mise a jour terminee"
