/**
 * @author tpasquet
 * @date 28/01/22
 * @version 1.0.0
 * @project SIEau
 * @table piezo_carte_situation
 */

# --- !Ups

alter table piezo_carte_situation add column typeindicateur integer;
alter table piezo_carte_situation add column typecalcul varchar(100);
alter table piezo_carte_situation add column debutperiode timestamp with time zone;
alter table piezo_carte_situation add column finperiode timestamp with time zone;
alter table piezo_carte_situation add column recurrence varchar(100);
alter table piezo_carte_situation add column typeid integer;
alter table piezo_carte_situation add column programmation boolean;
alter table piezo_carte_situation add column droitacces varchar(100);
alter table piezo_carte_situation add column pardefaut boolean;

create table hydro_carte_situation
(
    idcarte        integer,
    nomcarte       varchar(255),
    datecalcul     timestamp with time zone,
    loginmaj       varchar(255),
    datemaj        timestamp with time zone,
    nbvaleurs      integer,
    statut         integer,
    params         text,
    progress       double precision,
    typeindicateur integer,
    typecalcul     varchar(100),
    debutperiode   timestamp with time zone,
    finperiode     timestamp with time zone,
    recurrence     varchar(100),
    typeid         integer,
    programmation  boolean,
    droitacces     varchar(100),
    pardefaut      boolean
);

create table pluvio_carte_situation
(
    idcarte        integer,
    nomcarte       varchar(255),
    datecalcul     timestamp with time zone,
    loginmaj       varchar(255),
    datemaj        timestamp with time zone,
    nbvaleurs      integer,
    statut         integer,
    params         text,
    progress       double precision,
    typeindicateur integer,
    typecalcul     varchar(100),
    debutperiode   timestamp with time zone,
    finperiode     timestamp with time zone,
    recurrence     varchar(100),
    typeid         integer,
    programmation  boolean,
    droitacces     varchar(100),
    pardefaut      boolean
);

create table qualito_carte_situation
(
    idcarte        integer,
    nomcarte       varchar(255),
    datecalcul     timestamp with time zone,
    loginmaj       varchar(255),
    datemaj        timestamp with time zone,
    nbvaleurs      integer,
    statut         integer,
    params         text,
    progress       double precision,
    typeindicateur integer,
    typecalcul     varchar(100),
    debutperiode   timestamp with time zone,
    finperiode     timestamp with time zone,
    recurrence     varchar(100),
    typeid         integer,
    programmation  boolean,
    droitacces     varchar(100),
    pardefaut      boolean
);

alter table chroniques_calcul add column nomseuil varchar(255);
alter table chroniques_calcul add column valeurseuil double precision;

alter table chroniques_pluvio_calcul add column nomseuil varchar(255);
alter table chroniques_pluvio_calcul add column valeurseuil double precision;

alter table chroniques_hydro_calcul add column nomseuil varchar(255);
alter table chroniques_hydro_calcul add column valeurseuil double precision;

# --- !Downs
