VERS='5.71.022'

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

create table gc_aentpal 
  (
    num char(6),
    nodosr char(7),
    epr char(9),
    poids float,
    volume float,
    dt date,
    statut smallint,
    typpal char(2)
  );

create unique index ux_aentpal01 on gc_aentpal (num);

create table gc_aligpal 
  (
    num char(6),
    code char(12),
    id char(2),
    lit smallint,
    nblit smallint,
    nb float,
    colis float,
    qt float,
    pds float,
    dlv date,
    qtorg float,
    qtres float,
    numlig smallint
  );

create index ix_aligpal01 on gc_aligpal (num);

EOT

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

echo "Mise a jour terminee"
