VERS='5.4.30'

echo "Mise a jour de la base de donnees pour Version $VERS"

isql - - <<EOT

database gc;

update gc_parsys set version='$VERS';

drop table gc_thp;

create table gc_thp 
 (
   codvnd char(2) ,
   numdep smallint,
   dt     date    ,
   dtfin  date    ,
   fh1    smallint,
   lun    float   ,
   fh2    smallint,
   mar    float   ,
   fh3    smallint,
   mer    float   ,
   fh4    smallint,
   jeu    float   ,
   fh5    smallint,
   ven    float   ,
   fh6    smallint,
   sam    float   ,
   fh7    smallint,
   dim    float   ,
   total  float   ,
   traite smallint
 );

create unique index ix_thp01 on gc_thp (codvnd,numdep,dt);

close database;

EOT

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

echo "Mise a jour terminee"

