VERS='5.4.09'

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

isql - - <<EOT

database gc;

update gc_parsys set version='$VERS';

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

create table gc_trans 
  (
    code char(6),
    rsoc char(25),
    ad1 char(25),
    ad2 char(25),
    cpv char(25),
    telex char(15),
    tel char(15),
    fax char(15),
    respon char(25),
    commentreg char(60),
    delaia smallint
  );
create unique index ix_trans01 on gc_trans (code);

alter table gc_four add (trans char(6));
update gc_four set trans="000000" where trans is null;

update gc_cmd set trans="000000" where trans is null;
update gc_cmd set trans="000000" where trans=' ';

create index ix_cml03 on gc_cml (art);

alter table gc_soc add (passav char(5));

close database;

EOT

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

echo "Mise a jour terminee"

