--
--


-- Started on 2026-01-26 16:31:11

SELECT pg_catalog.set_config('search_path', '', false);

--
-- TOC entry 8 (class 2615 OID 2200)
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

--
-- TOC entry 7 (class 2615 OID 1509429)
-- Name: sav; Type: SCHEMA; Schema: -; Owner: frisquet
--

CREATE SCHEMA sav;


ALTER SCHEMA sav OWNER TO frisquet;

--
-- TOC entry 3 (class 3079 OID 675022)
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;


--
-- TOC entry 6648 (class 0 OID 0)
-- Dependencies: 3
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';


--
-- TOC entry 2 (class 3079 OID 717992)
-- Name: unaccent; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;


--
-- TOC entry 6649 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION unaccent; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION unaccent IS 'text search dictionary that removes accents';


--
-- TOC entry 1812 (class 1247 OID 1440257)
-- Name: obligation_courrier; Type: TYPE; Schema: public; Owner: frisquet
--

CREATE TYPE public.obligation_courrier AS ENUM (
    'NON',
    'OUI',
    'AR'
);


ALTER TYPE public.obligation_courrier OWNER TO frisquet;

--
-- TOC entry 1828 (class 1247 OID 996744)
-- Name: reparation; Type: TYPE; Schema: public; Owner: frisquet
--

CREATE TYPE public.reparation AS ENUM (
    'réalisées',
    'à faire'
);


ALTER TYPE public.reparation OWNER TO frisquet;

--
-- TOC entry 1822 (class 1247 OID 996725)
-- Name: titremesure; Type: TYPE; Schema: public; Owner: frisquet
--

CREATE TYPE public.titremesure AS ENUM (
    'ECS',
    'GAZ',
    'PAC'
);


ALTER TYPE public.titremesure OWNER TO frisquet;

--
-- TOC entry 1825 (class 1247 OID 996732)
-- Name: unitemesure; Type: TYPE; Schema: public; Owner: frisquet
--

CREATE TYPE public.unitemesure AS ENUM (
    '°C',
    'l/min',
    'mbar',
    'A',
    'V'
);


ALTER TYPE public.unitemesure OWNER TO frisquet;

--
-- TOC entry 1362 (class 1255 OID 718013)
-- Name: refresh_vmat_client(); Type: FUNCTION; Schema: public; Owner: frisquet
--

CREATE FUNCTION public.refresh_vmat_client() RETURNS trigger
    LANGUAGE plpgsql
    AS $$begin
    REFRESH MATERIALIZED VIEW  sav.vmat_clients_list WITH NO DATA;
return null;
end $$;


ALTER FUNCTION public.refresh_vmat_client() OWNER TO frisquet;

--
-- TOC entry 1363 (class 1255 OID 1509430)
-- Name: count_estimate(text); Type: FUNCTION; Schema: sav; Owner: frisquet
--

CREATE FUNCTION sav.count_estimate(query text) RETURNS integer
    LANGUAGE plpgsql
    AS $$
DECLARE
rec   record;
rows  integer;
BEGIN
FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP
        rows := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)');
        EXIT WHEN rows IS NOT NULL;
END LOOP;

    RETURN rows;
END
$$;


ALTER FUNCTION sav.count_estimate(query text) OWNER TO frisquet;

--
-- TOC entry 208 (class 1259 OID 718015)
-- Name: historique_equipement_id_seq; Type: SEQUENCE; Schema: public; Owner: frisquet
--

CREATE SEQUENCE public.historique_equipement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.historique_equipement_id_seq OWNER TO frisquet;

--
-- TOC entry 209 (class 1259 OID 718017)
-- Name: lock_entities_id_seq; Type: SEQUENCE; Schema: public; Owner: frisquet
--

CREATE SEQUENCE public.lock_entities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.lock_entities_id_seq OWNER TO frisquet;



--
-- TOC entry 210 (class 1259 OID 1509431)
-- Name: adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.adresse (
                             id bigint NOT NULL,
                             idtype_adresse bigint,
                             idtype_logement bigint,
                             adresse character varying(150),
                             adresse_complement character varying(150),
                             code_postal character varying(10),
                             ville character varying(150),
                             latitude double precision,
                             longitude double precision
);


ALTER TABLE sav.adresse OWNER TO frisquet;

--
-- TOC entry 211 (class 1259 OID 1509434)
-- Name: adresse_complement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.adresse_complement (
                                        id bigint NOT NULL,
                                        idadresse bigint,
                                        idtype_complement_adresse bigint DEFAULT 0,
                                        valeur character varying(50),
                                        commentaire_valeur text
);


ALTER TABLE sav.adresse_complement OWNER TO frisquet;

--
-- TOC entry 212 (class 1259 OID 1509441)
-- Name: adresse_complement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.adresse_complement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.adresse_complement_id_seq OWNER TO frisquet;

--
-- TOC entry 6650 (class 0 OID 0)
-- Dependencies: 212
-- Name: adresse_complement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.adresse_complement_id_seq OWNED BY sav.adresse_complement.id;


--
-- TOC entry 213 (class 1259 OID 1509443)
-- Name: adresse_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.adresse_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.adresse_id_seq OWNER TO frisquet;

--
-- TOC entry 6651 (class 0 OID 0)
-- Dependencies: 213
-- Name: adresse_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.adresse_id_seq OWNED BY sav.adresse.id;


--
-- TOC entry 214 (class 1259 OID 1509445)
-- Name: agence; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agence (
                            id bigint NOT NULL,
                            idsite bigint DEFAULT 0,
                            nom character varying(30),
                            raison_sociale character varying(40),
                            type_societe character varying(40),
                            banque character varying(20),
                            num_tel character varying(10),
                            code_client_agi character varying(9),
                            privilege boolean DEFAULT false
);


ALTER TABLE sav.agence OWNER TO frisquet;

--
-- TOC entry 215 (class 1259 OID 1509450)
-- Name: agence_adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agence_adresse (
                                    idagence bigint NOT NULL,
                                    idadresse bigint DEFAULT 0 NOT NULL,
                                    actif boolean DEFAULT true
);


ALTER TABLE sav.agence_adresse OWNER TO frisquet;

--
-- TOC entry 216 (class 1259 OID 1509455)
-- Name: agence_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.agence_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.agence_id_seq OWNER TO frisquet;

--
-- TOC entry 6652 (class 0 OID 0)
-- Dependencies: 216
-- Name: agence_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.agence_id_seq OWNED BY sav.agence.id;


--
-- TOC entry 217 (class 1259 OID 1509457)
-- Name: agent_appareil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_appareil (
                                    idappareil integer DEFAULT 0 NOT NULL,
                                    idutilisateur_agent bigint DEFAULT 0 NOT NULL,
                                    date_delivrance date,
                                    date_limite_renouvellement date,
                                    reference character varying(50),
                                    commentaire character varying(150),
                                    date_restitution date
);


ALTER TABLE sav.agent_appareil OWNER TO frisquet;

--
-- TOC entry 218 (class 1259 OID 1509462)
-- Name: agent_gps; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_gps (
                               id bigint NOT NULL,
                               date_heure timestamp(6) without time zone,
                               latitude double precision DEFAULT 0,
                               longitude double precision DEFAULT 0,
                               idutilisateur_agent bigint DEFAULT 0,
                               radius double precision DEFAULT 0
);


ALTER TABLE sav.agent_gps OWNER TO frisquet;

--
-- TOC entry 219 (class 1259 OID 1509469)
-- Name: agent_gps_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.agent_gps_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.agent_gps_id_seq OWNER TO frisquet;

--
-- TOC entry 6653 (class 0 OID 0)
-- Dependencies: 219
-- Name: agent_gps_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.agent_gps_id_seq OWNED BY sav.agent_gps.id;


--
-- TOC entry 220 (class 1259 OID 1509471)
-- Name: agent_produit_stock; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_produit_stock (
                                         idagent bigint DEFAULT 0 NOT NULL,
                                         idproduit bigint NOT NULL,
                                         idsite bigint,
                                         stock_reel integer DEFAULT 0,
                                         stock_theorique integer DEFAULT 0,
                                         idutilisateur bigint
);


ALTER TABLE sav.agent_produit_stock OWNER TO frisquet;

--
-- TOC entry 221 (class 1259 OID 1509477)
-- Name: agent_qualification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_qualification (
                                         idutilisateur_agent bigint DEFAULT 0 NOT NULL,
                                         idequipement_famille bigint DEFAULT 0 NOT NULL
);


ALTER TABLE sav.agent_qualification OWNER TO frisquet;

--
-- TOC entry 222 (class 1259 OID 1509482)
-- Name: agent_restriction; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_restriction (
                                       idutilisateur_agent bigint NOT NULL,
                                       idtype_planification bigint NOT NULL,
                                       date_debut date,
                                       date_fin date,
                                       motif text
);


ALTER TABLE sav.agent_restriction OWNER TO frisquet;

--
-- TOC entry 223 (class 1259 OID 1509488)
-- Name: agent_secteur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.agent_secteur (
                                   idsecteur_version bigint NOT NULL,
                                   idutilisateur_agent bigint DEFAULT 0 NOT NULL,
                                   rang_tri smallint DEFAULT 0
);


ALTER TABLE sav.agent_secteur OWNER TO frisquet;

--
-- TOC entry 224 (class 1259 OID 1509493)
-- Name: aide_technique; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.aide_technique (
                                    id double precision DEFAULT 0 NOT NULL,
                                    idequipement bigint,
                                    idtype_demandeur bigint,
                                    num_famille character varying(50),
                                    idaide_technique_etat double precision,
                                    provenance character varying(20),
                                    telephone character varying(14),
                                    objet character varying(400),
                                    idutilisateur_modif bigint DEFAULT 0,
                                    idutilisateur_reservation bigint,
                                    moyen_resolution character varying(1),
                                    motif character varying(1),
                                    envoi_doc character varying(1),
                                    email_doc character varying(260),
                                    adresse_doc character varying(250),
                                    urgence boolean DEFAULT false,
                                    pole smallint
);


ALTER TABLE sav.aide_technique OWNER TO frisquet;

--
-- TOC entry 225 (class 1259 OID 1509502)
-- Name: aide_technique_classification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.aide_technique_classification (
                                                   idaide_technique double precision DEFAULT 0 NOT NULL,
                                                   idaide_technique_classification_liste bigint DEFAULT 0 NOT NULL
);


ALTER TABLE sav.aide_technique_classification OWNER TO frisquet;

--
-- TOC entry 226 (class 1259 OID 1509507)
-- Name: aide_technique_classification_liste; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.aide_technique_classification_liste (
                                                         id bigint NOT NULL,
                                                         libelle_classification character varying(200)
);


ALTER TABLE sav.aide_technique_classification_liste OWNER TO frisquet;

--
-- TOC entry 227 (class 1259 OID 1509510)
-- Name: aide_technique_classification_liste_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.aide_technique_classification_liste_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.aide_technique_classification_liste_id_seq OWNER TO frisquet;

--
-- TOC entry 6654 (class 0 OID 0)
-- Dependencies: 227
-- Name: aide_technique_classification_liste_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.aide_technique_classification_liste_id_seq OWNED BY sav.aide_technique_classification_liste.id;


--
-- TOC entry 228 (class 1259 OID 1509512)
-- Name: aide_technique_etat; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.aide_technique_etat (
                                         id double precision NOT NULL,
                                         libelle character varying(20)
);


ALTER TABLE sav.aide_technique_etat OWNER TO frisquet;

--
-- TOC entry 229 (class 1259 OID 1509515)
-- Name: aide_technique_etat_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.aide_technique_etat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.aide_technique_etat_id_seq OWNER TO frisquet;

--
-- TOC entry 6655 (class 0 OID 0)
-- Dependencies: 229
-- Name: aide_technique_etat_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.aide_technique_etat_id_seq OWNED BY sav.aide_technique_etat.id;


--
-- TOC entry 230 (class 1259 OID 1509517)
-- Name: aide_technique_histo; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.aide_technique_histo (
                                          id bigint NOT NULL,
                                          idaide_technique double precision DEFAULT 0,
                                          date_heure timestamp(6) without time zone,
                                          idutilisateur bigint DEFAULT 0,
                                          commentaire text,
                                          idaide_technique_etat double precision
);


ALTER TABLE sav.aide_technique_histo OWNER TO frisquet;

--
-- TOC entry 231 (class 1259 OID 1509525)
-- Name: aide_technique_histo_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.aide_technique_histo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.aide_technique_histo_id_seq OWNER TO frisquet;

--
-- TOC entry 6656 (class 0 OID 0)
-- Dependencies: 231
-- Name: aide_technique_histo_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.aide_technique_histo_id_seq OWNED BY sav.aide_technique_histo.id;


--
-- TOC entry 232 (class 1259 OID 1509527)
-- Name: anomalie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie (
                              id bigint NOT NULL,
                              idanomalie_categorie smallint,
                              libelle text,
                              verifications text,
                              annotation_courrier text,
                              obligation_courrier public.obligation_courrier,
                              shutdown boolean,
                              make_modif boolean,
                              annotation_fit text,
                              contrat_possible boolean,
                              entretien_possible boolean,
                              depannage_possible boolean,
                              idanomalie_classification_neuve smallint,
                              idanomalie_classification_ancien smallint,
                              idanomalie_pro_contact smallint,
                              idanomalie_coupure_gaz smallint
);


ALTER TABLE sav.anomalie OWNER TO frisquet;

--
-- TOC entry 233 (class 1259 OID 1509533)
-- Name: anomalie_categorie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie_categorie (
                                        id smallint DEFAULT 0 NOT NULL,
                                        libelle character varying(255)
);


ALTER TABLE sav.anomalie_categorie OWNER TO frisquet;

--
-- TOC entry 234 (class 1259 OID 1509537)
-- Name: anomalie_categorie_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.anomalie_categorie_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.anomalie_categorie_id_seq OWNER TO frisquet;

--
-- TOC entry 6657 (class 0 OID 0)
-- Dependencies: 234
-- Name: anomalie_categorie_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.anomalie_categorie_id_seq OWNED BY sav.anomalie_categorie.id;


--
-- TOC entry 235 (class 1259 OID 1509539)
-- Name: anomalie_classification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie_classification (
                                             id smallint DEFAULT 0 NOT NULL,
                                             libelle character varying(255)
);


ALTER TABLE sav.anomalie_classification OWNER TO frisquet;

--
-- TOC entry 236 (class 1259 OID 1509543)
-- Name: anomalie_classification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.anomalie_classification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.anomalie_classification_id_seq OWNER TO frisquet;

--
-- TOC entry 6658 (class 0 OID 0)
-- Dependencies: 236
-- Name: anomalie_classification_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.anomalie_classification_id_seq OWNED BY sav.anomalie_classification.id;


--
-- TOC entry 237 (class 1259 OID 1509545)
-- Name: anomalie_coupure_gaz; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie_coupure_gaz (
                                          id smallint DEFAULT 0 NOT NULL,
                                          libelle character varying(255)
);


ALTER TABLE sav.anomalie_coupure_gaz OWNER TO frisquet;

--
-- TOC entry 238 (class 1259 OID 1509549)
-- Name: anomalie_coupure_gaz_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.anomalie_coupure_gaz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.anomalie_coupure_gaz_id_seq OWNER TO frisquet;

--
-- TOC entry 6659 (class 0 OID 0)
-- Dependencies: 238
-- Name: anomalie_coupure_gaz_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.anomalie_coupure_gaz_id_seq OWNED BY sav.anomalie_coupure_gaz.id;


--
-- TOC entry 239 (class 1259 OID 1509551)
-- Name: anomalie_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.anomalie_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.anomalie_id_seq OWNER TO frisquet;

--
-- TOC entry 6660 (class 0 OID 0)
-- Dependencies: 239
-- Name: anomalie_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.anomalie_id_seq OWNED BY sav.anomalie.id;


--
-- TOC entry 240 (class 1259 OID 1509553)
-- Name: anomalie_oracle; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie_oracle (
                                     id smallint DEFAULT 0 NOT NULL,
                                     libelle character varying(60),
                                     classe smallint,
                                     annotation character varying(70),
                                     flag_contrat boolean,
                                     courrier_souscripteur character varying(4),
                                     courrier_utilisateur character varying(4),
                                     courrier_installateur character varying(4),
                                     hierarchie smallint,
                                     paragraphe character varying(1)
);


ALTER TABLE sav.anomalie_oracle OWNER TO frisquet;

--
-- TOC entry 241 (class 1259 OID 1509557)
-- Name: anomalie_pro_contact; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.anomalie_pro_contact (
                                          id smallint DEFAULT 0 NOT NULL,
                                          libelle character varying(255)
);


ALTER TABLE sav.anomalie_pro_contact OWNER TO frisquet;

--
-- TOC entry 242 (class 1259 OID 1509561)
-- Name: anomalie_pro_contact_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.anomalie_pro_contact_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.anomalie_pro_contact_id_seq OWNER TO frisquet;

--
-- TOC entry 6661 (class 0 OID 0)
-- Dependencies: 242
-- Name: anomalie_pro_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.anomalie_pro_contact_id_seq OWNED BY sav.anomalie_pro_contact.id;


--
-- TOC entry 243 (class 1259 OID 1509563)
-- Name: appareil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.appareil (
                              id integer NOT NULL,
                              idtype_appareil bigint,
                              commentaire text,
                              marque character varying(32),
                              modele character varying(50),
                              metrologique boolean DEFAULT false,
                              actif boolean DEFAULT true,
                              idsite bigint
);


ALTER TABLE sav.appareil OWNER TO frisquet;

--
-- TOC entry 244 (class 1259 OID 1509571)
-- Name: appareil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.appareil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.appareil_id_seq OWNER TO frisquet;

--
-- TOC entry 6662 (class 0 OID 0)
-- Dependencies: 244
-- Name: appareil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.appareil_id_seq OWNED BY sav.appareil.id;


--
-- TOC entry 245 (class 1259 OID 1509573)
-- Name: attachement_parametre; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attachement_parametre (
                                           id bigint NOT NULL,
                                           idattachement_parametre_liste bigint,
                                           annee integer DEFAULT 0,
                                           semestre smallint DEFAULT 0,
                                           valeur integer DEFAULT 0
);


ALTER TABLE sav.attachement_parametre OWNER TO frisquet;

--
-- TOC entry 246 (class 1259 OID 1509579)
-- Name: attachement_parametre_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attachement_parametre_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attachement_parametre_id_seq OWNER TO frisquet;

--
-- TOC entry 6663 (class 0 OID 0)
-- Dependencies: 246
-- Name: attachement_parametre_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.attachement_parametre_id_seq OWNED BY sav.attachement_parametre.id;


--
-- TOC entry 247 (class 1259 OID 1509581)
-- Name: attachement_parametre_liste; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attachement_parametre_liste (
                                                 id integer NOT NULL,
                                                 libelle character varying(100),
                                                 type_calcul character varying(50)
);


ALTER TABLE sav.attachement_parametre_liste OWNER TO frisquet;

--
-- TOC entry 248 (class 1259 OID 1509584)
-- Name: attachement_parametre_liste_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attachement_parametre_liste_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attachement_parametre_liste_id_seq OWNER TO frisquet;

--
-- TOC entry 6664 (class 0 OID 0)
-- Dependencies: 248
-- Name: attachement_parametre_liste_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.attachement_parametre_liste_id_seq OWNED BY sav.attachement_parametre_liste.id;


--
-- TOC entry 249 (class 1259 OID 1509586)
-- Name: attachement_periode_froid; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attachement_periode_froid (
                                               id bigint NOT NULL,
                                               annee integer DEFAULT 0,
                                               semestre smallint DEFAULT 0,
                                               mois smallint DEFAULT 0
);


ALTER TABLE sav.attachement_periode_froid OWNER TO frisquet;

--
-- TOC entry 250 (class 1259 OID 1509592)
-- Name: attachement_periode_froid_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attachement_periode_froid_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attachement_periode_froid_id_seq OWNER TO frisquet;

--
-- TOC entry 6665 (class 0 OID 0)
-- Dependencies: 250
-- Name: attachement_periode_froid_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.attachement_periode_froid_id_seq OWNED BY sav.attachement_periode_froid.id;


--
-- TOC entry 251 (class 1259 OID 1509594)
-- Name: attachement_profil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attachement_profil (
                                        id bigint NOT NULL,
                                        idutilisateur_profil bigint,
                                        plafond_point integer DEFAULT 0,
                                        coefficient integer DEFAULT 0,
                                        valeur_point integer DEFAULT 0,
                                        annee integer DEFAULT 0,
                                        semestre smallint DEFAULT 0
);


ALTER TABLE sav.attachement_profil OWNER TO frisquet;

--
-- TOC entry 252 (class 1259 OID 1509602)
-- Name: attachement_profil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attachement_profil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attachement_profil_id_seq OWNER TO frisquet;

--
-- TOC entry 6666 (class 0 OID 0)
-- Dependencies: 252
-- Name: attachement_profil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.attachement_profil_id_seq OWNED BY sav.attachement_profil.id;


--
-- TOC entry 253 (class 1259 OID 1509604)
-- Name: attachement_type_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attachement_type_planification (
                                                    id bigint NOT NULL,
                                                    idtype_planification bigint DEFAULT 0,
                                                    annee integer DEFAULT 0,
                                                    mois smallint DEFAULT 0,
                                                    ponderation smallint DEFAULT 0
);


ALTER TABLE sav.attachement_type_planification OWNER TO frisquet;

--
-- TOC entry 254 (class 1259 OID 1509611)
-- Name: attachement_type_planification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attachement_type_planification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attachement_type_planification_id_seq OWNER TO frisquet;

--
-- TOC entry 6667 (class 0 OID 0)
-- Dependencies: 254
-- Name: attachement_type_planification_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.attachement_type_planification_id_seq OWNED BY sav.attachement_type_planification.id;


--
-- TOC entry 255 (class 1259 OID 1509613)
-- Name: attestation_entretien_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.attestation_entretien_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.attestation_entretien_id_seq OWNER TO frisquet;

--
-- TOC entry 256 (class 1259 OID 1509615)
-- Name: attestation_entretien; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attestation_entretien (
                                           id bigint DEFAULT nextval('sav.attestation_entretien_id_seq'::regclass) NOT NULL,
                                           date_dernier_entretien date,
                                           date_dernier_ramonage date,
                                           marque_appareil character varying(50),
                                           modele_appareil character varying(50),
                                           cli_refus_signature boolean,
                                           commentaire_refus_signature character varying(150),
                                           signataire_si_autre character varying(100)
);


ALTER TABLE sav.attestation_entretien OWNER TO frisquet;

--
-- TOC entry 257 (class 1259 OID 1509619)
-- Name: attestation_entretien_conseil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attestation_entretien_conseil (
                                                   idattestation_entretien bigint DEFAULT 0 NOT NULL,
                                                   idconseil bigint DEFAULT 0 NOT NULL
);


ALTER TABLE sav.attestation_entretien_conseil OWNER TO frisquet;

--
-- TOC entry 258 (class 1259 OID 1509624)
-- Name: attestation_entretien_point_controle; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.attestation_entretien_point_controle (
                                                          idattestation_entretien bigint DEFAULT 0 NOT NULL,
                                                          idpoint_controle bigint DEFAULT 0 NOT NULL,
                                                          valeur character varying(50),
                                                          idmotif_debit_gaz bigint
);


ALTER TABLE sav.attestation_entretien_point_controle OWNER TO frisquet;

--
-- TOC entry 259 (class 1259 OID 1509629)
-- Name: facture_categorie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture_categorie (
                                       id bigint NOT NULL,
                                       libelle_court character varying(2),
                                       libelle_long character varying(30)
);


ALTER TABLE sav.facture_categorie OWNER TO frisquet;

--
-- TOC entry 260 (class 1259 OID 1509632)
-- Name: categorie_facture_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.categorie_facture_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.categorie_facture_id_seq OWNER TO frisquet;

--
-- TOC entry 6668 (class 0 OID 0)
-- Dependencies: 260
-- Name: categorie_facture_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.categorie_facture_id_seq OWNED BY sav.facture_categorie.id;


--
-- TOC entry 261 (class 1259 OID 1509634)
-- Name: categorie_planification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.categorie_planification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.categorie_planification_id_seq OWNER TO frisquet;

--
-- TOC entry 262 (class 1259 OID 1509636)
-- Name: categorie_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.categorie_planification (
                                             id smallint DEFAULT nextval('sav.categorie_planification_id_seq'::regclass) NOT NULL,
                                             libelle character varying(30),
                                             flag_validation boolean
);


ALTER TABLE sav.categorie_planification OWNER TO frisquet;

--
-- TOC entry 6669 (class 0 OID 0)
-- Dependencies: 262
-- Name: TABLE categorie_planification; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.categorie_planification IS 'PLN_CATEGORIE_VISITE dans ORACLE';


--
-- TOC entry 6670 (class 0 OID 0)
-- Dependencies: 262
-- Name: COLUMN categorie_planification.libelle; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.categorie_planification.libelle IS 'Client, Interne, Absence diverses, Réunions';


--
-- TOC entry 6671 (class 0 OID 0)
-- Dependencies: 262
-- Name: COLUMN categorie_planification.flag_validation; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.categorie_planification.flag_validation IS 'INTERNE, REUNIONS -> true (nécessite une validation dans la tablette)\nABSENCES DIVERSES -> false (juste affichage dans la tablette)\nCLIENT -> null (intervention dans la tablette)';


--
-- TOC entry 263 (class 1259 OID 1509640)
-- Name: categorie_pro; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.categorie_pro (
                                   id integer NOT NULL,
                                   libelle character varying(30)
);


ALTER TABLE sav.categorie_pro OWNER TO frisquet;

--
-- TOC entry 264 (class 1259 OID 1509643)
-- Name: categorie_pro_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.categorie_pro_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.categorie_pro_id_seq OWNER TO frisquet;

--
-- TOC entry 6672 (class 0 OID 0)
-- Dependencies: 264
-- Name: categorie_pro_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.categorie_pro_id_seq OWNED BY sav.categorie_pro.id;


--
-- TOC entry 265 (class 1259 OID 1509645)
-- Name: cgv; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.cgv (
                         id bigint NOT NULL,
                         idequipement_famille_contrat bigint,
                         date_ajout timestamp(6) without time zone,
                         contenu text
);


ALTER TABLE sav.cgv OWNER TO frisquet;

--
-- TOC entry 266 (class 1259 OID 1509651)
-- Name: cgv_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.cgv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.cgv_id_seq OWNER TO frisquet;

--
-- TOC entry 6673 (class 0 OID 0)
-- Dependencies: 266
-- Name: cgv_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.cgv_id_seq OWNED BY sav.cgv.id;


--
-- TOC entry 267 (class 1259 OID 1509653)
-- Name: classe_energetique; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.classe_energetique (
                                        id smallint DEFAULT 0 NOT NULL,
                                        libelle character varying(15)
);


ALTER TABLE sav.classe_energetique OWNER TO frisquet;

--
-- TOC entry 268 (class 1259 OID 1509657)
-- Name: classe_rendement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.classe_rendement (
                                      id integer NOT NULL,
                                      libelle character varying(30)
);


ALTER TABLE sav.classe_rendement OWNER TO frisquet;

--
-- TOC entry 269 (class 1259 OID 1509660)
-- Name: classe_rendement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.classe_rendement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.classe_rendement_id_seq OWNER TO frisquet;

--
-- TOC entry 6674 (class 0 OID 0)
-- Dependencies: 269
-- Name: classe_rendement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.classe_rendement_id_seq OWNED BY sav.classe_rendement.id;


--
-- TOC entry 270 (class 1259 OID 1509662)
-- Name: classification_energetique; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.classification_energetique (
                                                id bigint NOT NULL,
                                                idequipement_type bigint DEFAULT 0,
                                                debut_fabrication timestamp(6) without time zone,
                                                fin_fabrication timestamp(6) without time zone,
                                                rendement integer,
                                                nox integer,
                                                evacuation_etanche smallint,
                                                ballon_integre smallint,
                                                idclasse_rendement smallint,
                                                debut_classe_energetique date,
                                                fin_classe_energetique date,
                                                idclasse_energetique smallint DEFAULT 0,
                                                rendement_reference integer,
                                                nox_reference integer
);


ALTER TABLE sav.classification_energetique OWNER TO frisquet;

--
-- TOC entry 271 (class 1259 OID 1509667)
-- Name: classification_energetique_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.classification_energetique_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.classification_energetique_id_seq OWNER TO frisquet;

--
-- TOC entry 6675 (class 0 OID 0)
-- Dependencies: 271
-- Name: classification_energetique_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.classification_energetique_id_seq OWNED BY sav.classification_energetique.id;


--
-- TOC entry 272 (class 1259 OID 1509669)
-- Name: client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.client (
                            id bigint NOT NULL,
                            idetat_civil bigint DEFAULT 0,
                            nom character varying(25),
                            prenom character varying(50),
                            idtype_client bigint,
                            idcategorie_pro bigint,
                            idcompte_client_web bigint,
                            nom_entreprise character varying,
                            num_siren character varying(9),
                            num_siret character varying(14),
                            num_tva_intra character varying(13),
                            opt_in_email boolean DEFAULT false,
                            opt_in_sms boolean DEFAULT false,
                            numero_client character varying(9),
                            idclient_tutelle bigint
);


ALTER TABLE sav.client OWNER TO frisquet;

--
-- TOC entry 273 (class 1259 OID 1509678)
-- Name: client_adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.client_adresse (
                                    idclient bigint NOT NULL,
                                    idadresse bigint DEFAULT 0 NOT NULL,
                                    actif boolean DEFAULT true,
                                    commentaire_tech text
);


ALTER TABLE sav.client_adresse OWNER TO frisquet;

--
-- TOC entry 274 (class 1259 OID 1509686)
-- Name: client_email; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.client_email (
                                  id bigint NOT NULL,
                                  idclient bigint,
                                  email character varying(260),
                                  commentaire_email character varying(50),
                                  actif boolean DEFAULT true
);


ALTER TABLE sav.client_email OWNER TO frisquet;

--
-- TOC entry 275 (class 1259 OID 1509690)
-- Name: client_email_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.client_email_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.client_email_id_seq OWNER TO frisquet;

--
-- TOC entry 6676 (class 0 OID 0)
-- Dependencies: 275
-- Name: client_email_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.client_email_id_seq OWNED BY sav.client_email.id;


--
-- TOC entry 276 (class 1259 OID 1509692)
-- Name: client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.client_id_seq OWNER TO frisquet;

--
-- TOC entry 6677 (class 0 OID 0)
-- Dependencies: 276
-- Name: client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.client_id_seq OWNED BY sav.client.id;


--
-- TOC entry 277 (class 1259 OID 1509694)
-- Name: client_site; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.client_site (
                                 idclient bigint NOT NULL,
                                 idsite bigint NOT NULL
);


ALTER TABLE sav.client_site OWNER TO frisquet;

--
-- TOC entry 278 (class 1259 OID 1509697)
-- Name: client_tel; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.client_tel (
                                id bigint NOT NULL,
                                idclient bigint,
                                num_tel character varying(15),
                                idtype_tel bigint DEFAULT 0,
                                commentaire_tel character varying(50),
                                priorite smallint DEFAULT 0,
                                fr boolean DEFAULT true
);


ALTER TABLE sav.client_tel OWNER TO frisquet;

--
-- TOC entry 279 (class 1259 OID 1509703)
-- Name: client_tel_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.client_tel_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.client_tel_id_seq OWNER TO frisquet;

--
-- TOC entry 6678 (class 0 OID 0)
-- Dependencies: 279
-- Name: client_tel_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.client_tel_id_seq OWNED BY sav.client_tel.id;


--
-- TOC entry 280 (class 1259 OID 1509705)
-- Name: code_postal_antennes; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.code_postal_antennes (
                                          idsite bigint NOT NULL,
                                          code_postal bigint NOT NULL
);


ALTER TABLE sav.code_postal_antennes OWNER TO frisquet;

--
-- TOC entry 281 (class 1259 OID 1509708)
-- Name: communication_canal; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.communication_canal (
                                         id integer NOT NULL,
                                         libelle character varying(50)
);


ALTER TABLE sav.communication_canal OWNER TO frisquet;

--
-- TOC entry 282 (class 1259 OID 1509711)
-- Name: communication_canal_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.communication_canal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.communication_canal_id_seq OWNER TO frisquet;

--
-- TOC entry 6679 (class 0 OID 0)
-- Dependencies: 282
-- Name: communication_canal_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.communication_canal_id_seq OWNED BY sav.communication_canal.id;


--
-- TOC entry 283 (class 1259 OID 1509713)
-- Name: communication_client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.communication_client (
                                          id bigint NOT NULL,
                                          idclient bigint,
                                          idequipement bigint,
                                          idintervention bigint,
                                          idcommunication_canal bigint,
                                          idcommunication_type bigint,
                                          idutilisateur bigint,
                                          date_heure_envoi timestamp(6) without time zone,
                                          date_heure_lecture timestamp(6) without time zone,
                                          id_campagne character varying(20),
                                          destination text
);


ALTER TABLE sav.communication_client OWNER TO frisquet;

--
-- TOC entry 284 (class 1259 OID 1509723)
-- Name: communication_client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.communication_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.communication_client_id_seq OWNER TO frisquet;

--
-- TOC entry 6680 (class 0 OID 0)
-- Dependencies: 284
-- Name: communication_client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.communication_client_id_seq OWNED BY sav.communication_client.id;


--
-- TOC entry 285 (class 1259 OID 1509725)
-- Name: communication_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.communication_type (
                                        id integer NOT NULL,
                                        libelle character varying(50)
);


ALTER TABLE sav.communication_type OWNER TO frisquet;

--
-- TOC entry 286 (class 1259 OID 1509728)
-- Name: communication_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.communication_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.communication_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6681 (class 0 OID 0)
-- Dependencies: 286
-- Name: communication_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.communication_type_id_seq OWNED BY sav.communication_type.id;


--
-- TOC entry 287 (class 1259 OID 1509730)
-- Name: compte_client_web; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.compte_client_web (
                                       id bigint NOT NULL,
                                       login_web character varying(64),
                                       password character varying(64)
);


ALTER TABLE sav.compte_client_web OWNER TO frisquet;

--
-- TOC entry 288 (class 1259 OID 1509733)
-- Name: compte_client_web_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.compte_client_web_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.compte_client_web_id_seq OWNER TO frisquet;

--
-- TOC entry 6682 (class 0 OID 0)
-- Dependencies: 288
-- Name: compte_client_web_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.compte_client_web_id_seq OWNED BY sav.compte_client_web.id;


--
-- TOC entry 289 (class 1259 OID 1509735)
-- Name: conseil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.conseil (
                             id bigint NOT NULL,
                             libelle character varying(250),
                             idtype_conseil bigint
);


ALTER TABLE sav.conseil OWNER TO frisquet;

--
-- TOC entry 290 (class 1259 OID 1509738)
-- Name: conseil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.conseil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.conseil_id_seq OWNER TO frisquet;

--
-- TOC entry 6683 (class 0 OID 0)
-- Dependencies: 290
-- Name: conseil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.conseil_id_seq OWNED BY sav.conseil.id;


--
-- TOC entry 291 (class 1259 OID 1509740)
-- Name: contrat; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat (
                             id bigint NOT NULL,
                             idequipement bigint DEFAULT 0,
                             idclient bigint DEFAULT 0,
                             idcontrat_type integer DEFAULT 0,
                             edition boolean DEFAULT false,
                             coefficient numeric(5,2) DEFAULT 0,
                             montant_ht numeric(9,2) DEFAULT 0,
                             idagent_souscription integer,
                             date_souscription timestamp(6) without time zone,
                             date_debut_contrat timestamp(6) without time zone,
                             date_fin_contrat timestamp(6) without time zone,
                             date_avis_echeance timestamp(6) without time zone,
                             date_paiement timestamp(6) without time zone,
                             commentaire text,
                             idfacture bigint,
                             groupe integer DEFAULT 0,
                             date_groupe date,
                             date_resiliation_groupe date,
                             dernier_contrat boolean DEFAULT true,
                             contrat_a_venir boolean DEFAULT false
);


ALTER TABLE sav.contrat OWNER TO frisquet;

--
-- TOC entry 292 (class 1259 OID 1509755)
-- Name: contrat_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_id_seq OWNER TO frisquet;

--
-- TOC entry 6684 (class 0 OID 0)
-- Dependencies: 292
-- Name: contrat_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_id_seq OWNED BY sav.contrat.id;


--
-- TOC entry 293 (class 1259 OID 1509757)
-- Name: contrat_motif_resiliation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_motif_resiliation (
                                               id integer NOT NULL,
                                               libelle character varying(50)
);


ALTER TABLE sav.contrat_motif_resiliation OWNER TO frisquet;

--
-- TOC entry 294 (class 1259 OID 1509760)
-- Name: contrat_motif_resiliation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_motif_resiliation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_motif_resiliation_id_seq OWNER TO frisquet;

--
-- TOC entry 6685 (class 0 OID 0)
-- Dependencies: 294
-- Name: contrat_motif_resiliation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_motif_resiliation_id_seq OWNED BY sav.contrat_motif_resiliation.id;


--
-- TOC entry 295 (class 1259 OID 1509762)
-- Name: contrat_plage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_plage (
                                   id integer NOT NULL,
                                   libelle character varying(30),
                                   min integer,
                                   max integer
);


ALTER TABLE sav.contrat_plage OWNER TO frisquet;

--
-- TOC entry 296 (class 1259 OID 1509765)
-- Name: contrat_plage_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_plage_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_plage_id_seq OWNER TO frisquet;

--
-- TOC entry 6686 (class 0 OID 0)
-- Dependencies: 296
-- Name: contrat_plage_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_plage_id_seq OWNED BY sav.contrat_plage.id;


--
-- TOC entry 297 (class 1259 OID 1509767)
-- Name: contrat_proposition; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_proposition (
                                         id bigint NOT NULL,
                                         idcontrat bigint,
                                         idcontrat_type bigint DEFAULT 0,
                                         montant_ht numeric(9,2) DEFAULT 0
);


ALTER TABLE sav.contrat_proposition OWNER TO frisquet;

--
-- TOC entry 298 (class 1259 OID 1509772)
-- Name: contrat_proposition_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_proposition_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_proposition_id_seq OWNER TO frisquet;

--
-- TOC entry 6687 (class 0 OID 0)
-- Dependencies: 298
-- Name: contrat_proposition_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_proposition_id_seq OWNED BY sav.contrat_proposition.id;


--
-- TOC entry 299 (class 1259 OID 1509774)
-- Name: contrat_regroupement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_regroupement (
                                          id integer NOT NULL,
                                          libelle character varying(30)
);


ALTER TABLE sav.contrat_regroupement OWNER TO frisquet;

--
-- TOC entry 300 (class 1259 OID 1509777)
-- Name: contrat_regroupement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_regroupement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_regroupement_id_seq OWNER TO frisquet;

--
-- TOC entry 6688 (class 0 OID 0)
-- Dependencies: 300
-- Name: contrat_regroupement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_regroupement_id_seq OWNED BY sav.contrat_regroupement.id;


--
-- TOC entry 301 (class 1259 OID 1509779)
-- Name: contrat_relance; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_relance (
                                     id bigint NOT NULL,
                                     idcontrat bigint DEFAULT 0,
                                     date timestamp(6) without time zone
);


ALTER TABLE sav.contrat_relance OWNER TO frisquet;

--
-- TOC entry 302 (class 1259 OID 1509783)
-- Name: contrat_relance_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_relance_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_relance_id_seq OWNER TO frisquet;

--
-- TOC entry 6689 (class 0 OID 0)
-- Dependencies: 302
-- Name: contrat_relance_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_relance_id_seq OWNED BY sav.contrat_relance.id;


--
-- TOC entry 303 (class 1259 OID 1509785)
-- Name: contrat_resiliation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_resiliation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_resiliation_id_seq OWNER TO frisquet;

--
-- TOC entry 304 (class 1259 OID 1509787)
-- Name: contrat_resiliation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_resiliation (
                                         id bigint DEFAULT nextval('sav.contrat_resiliation_id_seq'::regclass) NOT NULL,
                                         idcontrat bigint,
                                         idtype_envoi bigint,
                                         date date,
                                         idcontrat_motif_resiliation bigint,
                                         idequipement_marque bigint,
                                         idintervention bigint,
                                         motif_si_autre character varying(100)
);


ALTER TABLE sav.contrat_resiliation OWNER TO frisquet;

--
-- TOC entry 305 (class 1259 OID 1509791)
-- Name: contrat_tarif; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_tarif (
                                   id bigint NOT NULL,
                                   idcontrat_type bigint DEFAULT 0,
                                   idequipement_type_puissance bigint,
                                   tarif_contrat_ht numeric(24,2) DEFAULT 0,
                                   date_debut date,
                                   date_fin date,
                                   idcontrat_plage bigint
);


ALTER TABLE sav.contrat_tarif OWNER TO frisquet;

--
-- TOC entry 306 (class 1259 OID 1509796)
-- Name: contrat_tarif_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_tarif_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_tarif_id_seq OWNER TO frisquet;

--
-- TOC entry 6690 (class 0 OID 0)
-- Dependencies: 306
-- Name: contrat_tarif_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_tarif_id_seq OWNED BY sav.contrat_tarif.id;


--
-- TOC entry 307 (class 1259 OID 1509798)
-- Name: contrat_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.contrat_type (
                                  id integer NOT NULL,
                                  libelle_court character varying(8) NOT NULL,
                                  libelle_long character varying(60),
                                  idcontrat_regroupement integer
);


ALTER TABLE sav.contrat_type OWNER TO frisquet;

--
-- TOC entry 308 (class 1259 OID 1509801)
-- Name: contrat_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.contrat_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.contrat_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6691 (class 0 OID 0)
-- Dependencies: 308
-- Name: contrat_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.contrat_type_id_seq OWNED BY sav.contrat_type.id;


--
-- TOC entry 309 (class 1259 OID 1509803)
-- Name: courrier_client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.courrier_client (
                                     id bigint NOT NULL,
                                     idequipement bigint,
                                     idintervention bigint,
                                     anomalie integer,
                                     agt_groupe smallint,
                                     souscripteur character varying(4),
                                     utilisateur character varying(4),
                                     installateur character varying(4),
                                     paragraphes character varying(4),
                                     status smallint,
                                     date_envoi timestamp(6) without time zone,
                                     email_destinataire character varying(255),
                                     num_courrier smallint,
                                     commentaire character varying(160),
                                     prev_envoi timestamp(6) without time zone,
                                     prev_courrier smallint,
                                     index_courrier_client bytea
);


ALTER TABLE sav.courrier_client OWNER TO frisquet;

--
-- TOC entry 310 (class 1259 OID 1509809)
-- Name: courrier_client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.courrier_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.courrier_client_id_seq OWNER TO frisquet;

--
-- TOC entry 6692 (class 0 OID 0)
-- Dependencies: 310
-- Name: courrier_client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.courrier_client_id_seq OWNED BY sav.courrier_client.id;


--
-- TOC entry 311 (class 1259 OID 1509811)
-- Name: demande_documentation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.demande_documentation (
                                           id bigint NOT NULL,
                                           idtype_demandeur bigint DEFAULT 0,
                                           idequipement bigint DEFAULT 0,
                                           code_agi character varying(9),
                                           canal_envoi character varying(50),
                                           ref_doc character varying(50)
);


ALTER TABLE sav.demande_documentation OWNER TO frisquet;

--
-- TOC entry 312 (class 1259 OID 1509816)
-- Name: demande_documentation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.demande_documentation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.demande_documentation_id_seq OWNER TO frisquet;

--
-- TOC entry 6693 (class 0 OID 0)
-- Dependencies: 312
-- Name: demande_documentation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.demande_documentation_id_seq OWNED BY sav.demande_documentation.id;


--
-- TOC entry 313 (class 1259 OID 1509818)
-- Name: devis; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.devis (
                           id bigint NOT NULL,
                           idintervention bigint,
                           num_devis character varying(11),
                           iddevis_statut bigint,
                           montant_ht numeric(24,2),
                           montant_ttc numeric(24,2),
                           date_emission timestamp(6) without time zone,
                           idtype_devise bigint,
                           cli_refus_signature boolean,
                           commentaire_refus_signature character varying(200),
                           idtype_envoi bigint,
                           idmag_commande bigint,
                           stack bytea
);


ALTER TABLE sav.devis OWNER TO frisquet;

--
-- TOC entry 314 (class 1259 OID 1509824)
-- Name: devis_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.devis_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.devis_id_seq OWNER TO frisquet;

--
-- TOC entry 6694 (class 0 OID 0)
-- Dependencies: 314
-- Name: devis_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.devis_id_seq OWNED BY sav.devis.id;


--
-- TOC entry 315 (class 1259 OID 1509826)
-- Name: devis_ligne; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.devis_ligne (
                                 id bigint NOT NULL,
                                 iddevis bigint,
                                 idproduit bigint,
                                 code_article character varying(15),
                                 designation character varying(100),
                                 quantite integer,
                                 pu_ht numeric(24,2),
                                 idtaux_tva bigint,
                                 remise integer,
                                 pu_ttc numeric(24,2),
                                 prix_total_tva numeric(24,2),
                                 prix_total_ttc numeric(24,2),
                                 idproduit_facture_affectation bigint,
                                 motif_service character varying(200)
);


ALTER TABLE sav.devis_ligne OWNER TO frisquet;

--
-- TOC entry 316 (class 1259 OID 1509829)
-- Name: devis_ligne_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.devis_ligne_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.devis_ligne_id_seq OWNER TO frisquet;

--
-- TOC entry 6695 (class 0 OID 0)
-- Dependencies: 316
-- Name: devis_ligne_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.devis_ligne_id_seq OWNED BY sav.devis_ligne.id;


--
-- TOC entry 317 (class 1259 OID 1509831)
-- Name: devis_statut; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.devis_statut (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.devis_statut OWNER TO frisquet;

--
-- TOC entry 318 (class 1259 OID 1509834)
-- Name: devis_statut_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.devis_statut_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.devis_statut_id_seq OWNER TO frisquet;

--
-- TOC entry 6696 (class 0 OID 0)
-- Dependencies: 318
-- Name: devis_statut_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.devis_statut_id_seq OWNED BY sav.devis_statut.id;


--
-- TOC entry 319 (class 1259 OID 1509836)
-- Name: droit_portail_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.droit_portail_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.droit_portail_id_seq OWNER TO frisquet;

--
-- TOC entry 320 (class 1259 OID 1509838)
-- Name: droit_portail; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.droit_portail (
                                   id integer DEFAULT nextval('sav.droit_portail_id_seq'::regclass) NOT NULL,
                                   idgroupe_droit_portail integer NOT NULL,
                                   libelle character varying(50) NOT NULL
);


ALTER TABLE sav.droit_portail OWNER TO frisquet;

--
-- TOC entry 321 (class 1259 OID 1509842)
-- Name: energie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.energie (
                             id integer NOT NULL,
                             libelle_court character varying(5),
                             libelle_long character varying(30),
                             affichage_tablette boolean DEFAULT false,
                             idtype_energie integer
);


ALTER TABLE sav.energie OWNER TO frisquet;

--
-- TOC entry 322 (class 1259 OID 1509846)
-- Name: equipement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement (
                                id bigint NOT NULL,
                                idclient_souscripteur bigint DEFAULT 0,
                                num_serie_principal character varying(14) COLLATE pg_catalog."C",
                                num_serie_secondaire character varying(14) COLLATE pg_catalog."C",
                                num_upec character varying(14),
                                idequipement_type_puissance integer DEFAULT 0,
                                idenergie integer,
                                idequipement_tranche integer,
                                logement_plus_2_ans boolean,
                                date_premier_allumage timestamp(6) without time zone,
                                actif boolean DEFAULT true,
                                idadresse bigint,
                                salarie_frisquet boolean DEFAULT false,
                                idequipement_famille_contrat integer DEFAULT 0,
                                idequipement_local smallint,
                                lieu_si_autre character varying(30),
                                idsecteur bigint,
                                idraccordement integer,
                                idinstallateur bigint,
                                idtaux_tva bigint,
                                idclient_utilisateur bigint,
                                idsite integer,
                                chantier bigint,
                                date_debut_garantie date,
                                date_fin_garantie date,
                                contact_fin_garantie boolean,
                                idequipement_famille bigint,
                                numero_client_oracle character varying(30),
                                date_eligible_privilege date,
                                remplacement_privilege boolean DEFAULT false,
                                date_eligible_po date,
                                remplacement_po boolean DEFAULT false,
                                logement_vide boolean DEFAULT false,
                                date_derniere_v1 date,
                                commentaire_desactivation text,
                                installateur_observation text,
                                idclient_ancien_souscripteur bigint,
                                date_ancien_souscripteur date,
                                idequipement_alimentation bigint,
                                idequipement_fluide bigint,
                                charge_totale numeric(24,2),
                                tonnage_eq_co2 numeric(24,2),
                                ballon_deporte boolean,
                                ballon_capacite integer,
                                idequipement_releve bigint,
                                idequipement_ancien bigint,
                                a_servir boolean DEFAULT false
);


ALTER TABLE sav.equipement OWNER TO frisquet;

--
-- TOC entry 6697 (class 0 OID 0)
-- Dependencies: 322
-- Name: COLUMN equipement.chantier; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.equipement.chantier IS 'Permet de spécifier un numéro de chantier pour un équipement.';


--
-- TOC entry 323 (class 1259 OID 1509861)
-- Name: equipement_alimentation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_alimentation (
                                             id bigint NOT NULL,
                                             libelle character varying(100) NOT NULL
);


ALTER TABLE sav.equipement_alimentation OWNER TO frisquet;

--
-- TOC entry 324 (class 1259 OID 1509864)
-- Name: equipement_alimentation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_alimentation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_alimentation_id_seq OWNER TO frisquet;

--
-- TOC entry 6698 (class 0 OID 0)
-- Dependencies: 324
-- Name: equipement_alimentation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_alimentation_id_seq OWNED BY sav.equipement_alimentation.id;


--
-- TOC entry 325 (class 1259 OID 1509866)
-- Name: equipement_complement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_complement (
                                           idequipement bigint DEFAULT 0 NOT NULL,
                                           idtype_complement bigint DEFAULT 0 NOT NULL,
                                           present boolean DEFAULT false,
                                           num_serie_frisquet character varying(30),
                                           idequipement_marque bigint
);


ALTER TABLE sav.equipement_complement OWNER TO frisquet;

--
-- TOC entry 326 (class 1259 OID 1509872)
-- Name: equipement_famille_contrat; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_famille_contrat (
                                                id bigint NOT NULL,
                                                code smallint DEFAULT 0 NOT NULL,
                                                libelle character varying(60)
);


ALTER TABLE sav.equipement_famille_contrat OWNER TO frisquet;

--
-- TOC entry 327 (class 1259 OID 1509876)
-- Name: equipement_famille_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_famille_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_famille_id_seq OWNER TO frisquet;

--
-- TOC entry 6699 (class 0 OID 0)
-- Dependencies: 327
-- Name: equipement_famille_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_famille_id_seq OWNED BY sav.equipement_famille_contrat.id;


--
-- TOC entry 328 (class 1259 OID 1509878)
-- Name: equipement_famille; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_famille (
                                        id integer DEFAULT nextval('sav.equipement_famille_id_seq'::regclass) NOT NULL,
                                        code smallint DEFAULT 0 NOT NULL,
                                        libelle character varying(60)
);


ALTER TABLE sav.equipement_famille OWNER TO frisquet;

--
-- TOC entry 329 (class 1259 OID 1509883)
-- Name: equipement_famille_contrat_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_famille_contrat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_famille_contrat_id_seq OWNER TO frisquet;

--
-- TOC entry 6700 (class 0 OID 0)
-- Dependencies: 329
-- Name: equipement_famille_contrat_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_famille_contrat_id_seq OWNED BY sav.equipement_famille_contrat.id;


--
-- TOC entry 330 (class 1259 OID 1509885)
-- Name: equipement_fluide; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_fluide (
                                       id bigint NOT NULL,
                                       libelle character varying(100) NOT NULL,
                                       taux_conversion numeric(24,2)
);


ALTER TABLE sav.equipement_fluide OWNER TO frisquet;

--
-- TOC entry 331 (class 1259 OID 1509888)
-- Name: equipement_fluide_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_fluide_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_fluide_id_seq OWNER TO frisquet;

--
-- TOC entry 6701 (class 0 OID 0)
-- Dependencies: 331
-- Name: equipement_fluide_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_fluide_id_seq OWNED BY sav.equipement_fluide.id;


--
-- TOC entry 332 (class 1259 OID 1509890)
-- Name: equipement_groupe; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_groupe (
                                       id bigint NOT NULL,
                                       numero_groupe integer DEFAULT 0,
                                       idequipement bigint DEFAULT 0,
                                       idequipement_groupe_type bigint
);


ALTER TABLE sav.equipement_groupe OWNER TO frisquet;

--
-- TOC entry 333 (class 1259 OID 1509895)
-- Name: equipement_groupe_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_groupe_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_groupe_id_seq OWNER TO frisquet;

--
-- TOC entry 6702 (class 0 OID 0)
-- Dependencies: 333
-- Name: equipement_groupe_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_groupe_id_seq OWNED BY sav.equipement_groupe.id;


--
-- TOC entry 334 (class 1259 OID 1509897)
-- Name: equipement_groupe_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_groupe_type (
                                            id integer NOT NULL,
                                            libelle character varying(50),
                                            commentaire_dev text
);


ALTER TABLE sav.equipement_groupe_type OWNER TO frisquet;

--
-- TOC entry 335 (class 1259 OID 1509903)
-- Name: equipement_groupe_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_groupe_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_groupe_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6703 (class 0 OID 0)
-- Dependencies: 335
-- Name: equipement_groupe_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_groupe_type_id_seq OWNED BY sav.equipement_groupe_type.id;


--
-- TOC entry 336 (class 1259 OID 1509905)
-- Name: equipement_hauteur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_hauteur (
                                        id integer NOT NULL,
                                        idequipement bigint DEFAULT 0 NOT NULL,
                                        idintervention bigint,
                                        date date NOT NULL,
                                        hauteur numeric(4,2),
                                        mesure_possible boolean,
                                        escabeau_ok boolean,
                                        entretien_ok boolean,
                                        hauteur_module_ext numeric(4,2),
                                        mesure_possible_module_ext boolean,
                                        escabeau_ok_module_ext boolean,
                                        entretien_ok_module_ext boolean
);


ALTER TABLE sav.equipement_hauteur OWNER TO frisquet;

--
-- TOC entry 337 (class 1259 OID 1509909)
-- Name: equipement_hauteur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_hauteur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_hauteur_id_seq OWNER TO frisquet;

--
-- TOC entry 6704 (class 0 OID 0)
-- Dependencies: 337
-- Name: equipement_hauteur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_hauteur_id_seq OWNED BY sav.equipement_hauteur.id;


--
-- TOC entry 338 (class 1259 OID 1509911)
-- Name: equipement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_id_seq OWNER TO frisquet;

--
-- TOC entry 6705 (class 0 OID 0)
-- Dependencies: 338
-- Name: equipement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_id_seq OWNED BY sav.equipement.id;


--
-- TOC entry 339 (class 1259 OID 1509913)
-- Name: equipement_installation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_installation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_installation_id_seq OWNER TO frisquet;

--
-- TOC entry 340 (class 1259 OID 1509915)
-- Name: equipement_installation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_installation (
                                             id bigint DEFAULT nextval('sav.equipement_installation_id_seq'::regclass) NOT NULL,
                                             idequipement bigint,
                                             idtype_installation bigint,
                                             idprotection_sanitaire bigint,
                                             idrobinet_remplissage bigint,
                                             robinet_si_autre character varying(50),
                                             localisation character varying(150)
);


ALTER TABLE sav.equipement_installation OWNER TO frisquet;

--
-- TOC entry 341 (class 1259 OID 1509919)
-- Name: equipement_local; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_local (
                                      id smallint NOT NULL,
                                      libelle character varying(30)
);


ALTER TABLE sav.equipement_local OWNER TO frisquet;

--
-- TOC entry 342 (class 1259 OID 1509922)
-- Name: equipement_local_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_local_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_local_id_seq OWNER TO frisquet;

--
-- TOC entry 6706 (class 0 OID 0)
-- Dependencies: 342
-- Name: equipement_local_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_local_id_seq OWNED BY sav.equipement_local.id;


--
-- TOC entry 343 (class 1259 OID 1509924)
-- Name: equipement_marque; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_marque (
                                       id bigint NOT NULL,
                                       libelle character varying(100) NOT NULL
);


ALTER TABLE sav.equipement_marque OWNER TO frisquet;

--
-- TOC entry 344 (class 1259 OID 1509927)
-- Name: equipement_marque_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_marque_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_marque_id_seq OWNER TO frisquet;

--
-- TOC entry 6707 (class 0 OID 0)
-- Dependencies: 344
-- Name: equipement_marque_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_marque_id_seq OWNED BY sav.equipement_marque.id;


--
-- TOC entry 345 (class 1259 OID 1509929)
-- Name: equipement_mesure; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_mesure (
                                       idequipement bigint DEFAULT 0 NOT NULL,
                                       idintervention bigint NOT NULL,
                                       date timestamp(6) without time zone,
                                       temp_ecs bigint,
                                       temp_efs bigint,
                                       delta_temp bigint,
                                       debit_ecs bigint,
                                       pression_gaz_statique bigint,
                                       pression_gaz_dynamique bigint,
                                       pression_injection bigint,
                                       debit_gaz bigint,
                                       temp_condenseur bigint,
                                       temp_in_gazeux_condenseur bigint,
                                       temp_out_liquide_condenseur bigint,
                                       temp_in_liquide_evaporateur bigint,
                                       temp_out_gazeux_evaporateur bigint,
                                       intensite_module_ext bigint,
                                       tension_statique_module_int bigint,
                                       tension_dynamique_module_int bigint,
                                       tension_statique_module_ext bigint,
                                       tension_dynamique_module_ext bigint
);


ALTER TABLE sav.equipement_mesure OWNER TO frisquet;

--
-- TOC entry 346 (class 1259 OID 1509933)
-- Name: equipement_option; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_option (
                                       id bigint NOT NULL,
                                       idequipement bigint,
                                       idoption bigint DEFAULT 0,
                                       sous_contrat boolean,
                                       date_souscription date,
                                       prix_ht numeric(24,2),
                                       date_debut date,
                                       date_resiliation date,
                                       date_fin date
);


ALTER TABLE sav.equipement_option OWNER TO frisquet;

--
-- TOC entry 6708 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN equipement_option.date_debut; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.equipement_option.date_debut IS 'Si sous contrat correspond à la date de début du contrat en cours ou à venir. Sinon = date souscription.';


--
-- TOC entry 6709 (class 0 OID 0)
-- Dependencies: 346
-- Name: COLUMN equipement_option.date_fin; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.equipement_option.date_fin IS 'Si sous contrat correspond à la date de findu contrat en cours. Sinon = date resiliation.';


--
-- TOC entry 347 (class 1259 OID 1509937)
-- Name: equipement_option_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_option_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_option_id_seq OWNER TO frisquet;

--
-- TOC entry 6710 (class 0 OID 0)
-- Dependencies: 347
-- Name: equipement_option_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_option_id_seq OWNED BY sav.equipement_option.id;


--
-- TOC entry 348 (class 1259 OID 1509939)
-- Name: equipement_preferences_planification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_preferences_planification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_preferences_planification_id_seq OWNER TO frisquet;

--
-- TOC entry 349 (class 1259 OID 1509941)
-- Name: equipement_preferences_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_preferences_planification (
                                                          id bigint DEFAULT nextval('sav.equipement_preferences_planification_id_seq'::regclass) NOT NULL,
                                                          idequipement bigint,
                                                          date_a_partir_du date,
                                                          date_avant_le date,
                                                          date_entre_debut date,
                                                          date_entre_fin date,
                                                          planifier_preference character varying(25),
                                                          planifier_jour character varying(60),
                                                          planifier_partie_journee character varying(15),
                                                          planifier_avant_apres character varying(12),
                                                          avant_recurrente boolean DEFAULT false,
                                                          apres_recurrente boolean DEFAULT false,
                                                          inclusion_recurrente boolean DEFAULT false,
                                                          uniquement_scolaire boolean DEFAULT false,
                                                          premiere_visite boolean DEFAULT false,
                                                          envoyer_2_agents boolean DEFAULT false,
                                                          envoyer_rts boolean DEFAULT false,
                                                          idagent bigint,
                                                          planifier_agent character varying(20),
                                                          idhoraire_passage integer
);


ALTER TABLE sav.equipement_preferences_planification OWNER TO frisquet;

--
-- TOC entry 350 (class 1259 OID 1509952)
-- Name: equipement_puissance; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_puissance (
                                          id integer NOT NULL,
                                          libelle integer DEFAULT 0 NOT NULL
);


ALTER TABLE sav.equipement_puissance OWNER TO frisquet;

--
-- TOC entry 351 (class 1259 OID 1509956)
-- Name: equipement_puissance_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_puissance_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_puissance_id_seq OWNER TO frisquet;

--
-- TOC entry 6711 (class 0 OID 0)
-- Dependencies: 351
-- Name: equipement_puissance_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_puissance_id_seq OWNED BY sav.equipement_puissance.id;


--
-- TOC entry 352 (class 1259 OID 1509958)
-- Name: equipement_releve; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_releve (
                                       id bigint NOT NULL,
                                       libelle character varying(100) NOT NULL
);


ALTER TABLE sav.equipement_releve OWNER TO frisquet;

--
-- TOC entry 353 (class 1259 OID 1509961)
-- Name: equipement_releve_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_releve_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_releve_id_seq OWNER TO frisquet;

--
-- TOC entry 6712 (class 0 OID 0)
-- Dependencies: 353
-- Name: equipement_releve_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_releve_id_seq OWNED BY sav.equipement_releve.id;


--
-- TOC entry 354 (class 1259 OID 1509963)
-- Name: equipement_tranche; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_tranche (
                                        id integer NOT NULL,
                                        age smallint DEFAULT 0,
                                        plus_value numeric(6,2) DEFAULT 0
);


ALTER TABLE sav.equipement_tranche OWNER TO frisquet;

--
-- TOC entry 355 (class 1259 OID 1509968)
-- Name: equipement_tranche_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_tranche_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_tranche_id_seq OWNER TO frisquet;

--
-- TOC entry 6713 (class 0 OID 0)
-- Dependencies: 355
-- Name: equipement_tranche_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_tranche_id_seq OWNED BY sav.equipement_tranche.id;


--
-- TOC entry 356 (class 1259 OID 1509970)
-- Name: equipement_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_type (
                                     id integer NOT NULL,
                                     type character varying(8),
                                     libelle character varying(50),
                                     ctrl_co boolean DEFAULT false
);


ALTER TABLE sav.equipement_type OWNER TO frisquet;

--
-- TOC entry 357 (class 1259 OID 1509974)
-- Name: equipement_type_famille; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_type_famille (
                                             id bigint NOT NULL,
                                             idequipement_type bigint,
                                             debut_famille date,
                                             fin_famille date,
                                             idequipement_famille bigint
);


ALTER TABLE sav.equipement_type_famille OWNER TO frisquet;

--
-- TOC entry 358 (class 1259 OID 1509977)
-- Name: equipement_type_famille_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_type_famille_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_type_famille_id_seq OWNER TO frisquet;

--
-- TOC entry 6714 (class 0 OID 0)
-- Dependencies: 358
-- Name: equipement_type_famille_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_type_famille_id_seq OWNED BY sav.equipement_type_famille.id;


--
-- TOC entry 359 (class 1259 OID 1509979)
-- Name: equipement_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6715 (class 0 OID 0)
-- Dependencies: 359
-- Name: equipement_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_type_id_seq OWNED BY sav.equipement_type.id;


--
-- TOC entry 360 (class 1259 OID 1509981)
-- Name: equipement_type_option; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_type_option (
                                            idequipement_type bigint NOT NULL,
                                            idoption bigint NOT NULL
);


ALTER TABLE sav.equipement_type_option OWNER TO frisquet;

--
-- TOC entry 361 (class 1259 OID 1509984)
-- Name: equipement_type_puissance; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_type_puissance (
                                               id bigint NOT NULL,
                                               idequipement_type bigint,
                                               idequipement_puissance bigint
);


ALTER TABLE sav.equipement_type_puissance OWNER TO frisquet;

--
-- TOC entry 362 (class 1259 OID 1509987)
-- Name: equipement_type_puissance_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.equipement_type_puissance_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.equipement_type_puissance_id_seq OWNER TO frisquet;

--
-- TOC entry 6716 (class 0 OID 0)
-- Dependencies: 362
-- Name: equipement_type_puissance_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.equipement_type_puissance_id_seq OWNED BY sav.equipement_type_puissance.id;


--
-- TOC entry 363 (class 1259 OID 1509989)
-- Name: equipement_zone; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.equipement_zone (
                                     idequipement bigint DEFAULT 0 NOT NULL,
                                     idtype_zone bigint DEFAULT 0 NOT NULL,
                                     numero smallint NOT NULL,
                                     precision_si_autre character varying
);


ALTER TABLE sav.equipement_zone OWNER TO frisquet;

--
-- TOC entry 364 (class 1259 OID 1509997)
-- Name: etat_civil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.etat_civil (
                                id integer NOT NULL,
                                libelle_court character varying(15),
                                libelle_long character varying(30)
);


ALTER TABLE sav.etat_civil OWNER TO frisquet;

--
-- TOC entry 365 (class 1259 OID 1510000)
-- Name: etat_civil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.etat_civil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.etat_civil_id_seq OWNER TO frisquet;

--
-- TOC entry 6717 (class 0 OID 0)
-- Dependencies: 365
-- Name: etat_civil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.etat_civil_id_seq OWNED BY sav.etat_civil.id;


--
-- TOC entry 366 (class 1259 OID 1510002)
-- Name: evenement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.evenement (
                               idplanning bigint NOT NULL,
                               idtype_planification smallint NOT NULL,
                               idagence integer,
                               idevenement_lieu integer,
                               idevenement_objet integer,
                               idformation integer,
                               est_formateur boolean,
                               objet_si_autre character varying(200),
                               duree smallint
);


ALTER TABLE sav.evenement OWNER TO frisquet;

--
-- TOC entry 6718 (class 0 OID 0)
-- Dependencies: 366
-- Name: TABLE evenement; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.evenement IS 'formation, réunion, test, controle voiture, maladie, réserve, passage bureau, passage magasin';


--
-- TOC entry 6719 (class 0 OID 0)
-- Dependencies: 366
-- Name: COLUMN evenement.idevenement_lieu; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement.idevenement_lieu IS 'si pas agence';


--
-- TOC entry 6720 (class 0 OID 0)
-- Dependencies: 366
-- Name: COLUMN evenement.idformation; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement.idformation IS 'Si formation';


--
-- TOC entry 6721 (class 0 OID 0)
-- Dependencies: 366
-- Name: COLUMN evenement.est_formateur; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement.est_formateur IS 'Si formation, définit si c''est l''agent qui est formateur.';


--
-- TOC entry 6722 (class 0 OID 0)
-- Dependencies: 366
-- Name: COLUMN evenement.objet_si_autre; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement.objet_si_autre IS 'pour maladie';


--
-- TOC entry 6723 (class 0 OID 0)
-- Dependencies: 366
-- Name: COLUMN evenement.duree; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement.duree IS 'en jours, pour maladie';


--
-- TOC entry 367 (class 1259 OID 1510005)
-- Name: evenement_lieu_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.evenement_lieu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.evenement_lieu_id_seq OWNER TO frisquet;

--
-- TOC entry 368 (class 1259 OID 1510007)
-- Name: evenement_lieu; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.evenement_lieu (
                                    id integer DEFAULT nextval('sav.evenement_lieu_id_seq'::regclass) NOT NULL,
                                    libelle_court character varying(20),
                                    libelle_long character varying(50),
                                    actif boolean,
                                    idsite smallint
);


ALTER TABLE sav.evenement_lieu OWNER TO frisquet;

--
-- TOC entry 6724 (class 0 OID 0)
-- Dependencies: 368
-- Name: TABLE evenement_lieu; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.evenement_lieu IS 'lieux si pas agence';


--
-- TOC entry 6725 (class 0 OID 0)
-- Dependencies: 368
-- Name: COLUMN evenement_lieu.idsite; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.evenement_lieu.idsite IS 'A voir si commun à tous les sites\nprendre le même principe que les produits si null commun sinon spécifique site';


--
-- TOC entry 369 (class 1259 OID 1510011)
-- Name: evenement_lieu_type_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.evenement_lieu_type_planification (
                                                       idevenement_lieu integer NOT NULL,
                                                       idtype_planification smallint NOT NULL
);


ALTER TABLE sav.evenement_lieu_type_planification OWNER TO frisquet;

--
-- TOC entry 370 (class 1259 OID 1510014)
-- Name: evenement_objet_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.evenement_objet_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.evenement_objet_id_seq OWNER TO frisquet;

--
-- TOC entry 371 (class 1259 OID 1510016)
-- Name: evenement_objet; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.evenement_objet (
                                     id integer DEFAULT nextval('sav.evenement_objet_id_seq'::regclass) NOT NULL,
                                     libelle_court character varying(20),
                                     libelle_long character varying(50),
                                     actif boolean,
                                     idtype_planification integer
);


ALTER TABLE sav.evenement_objet OWNER TO frisquet;

--
-- TOC entry 372 (class 1259 OID 1510020)
-- Name: facture; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture (
                             id bigint NOT NULL,
                             num_facture character varying(11) DEFAULT '0'::character varying NOT NULL,
                             num_facture_oracle integer DEFAULT 0,
                             num_facture_reference integer,
                             idequipement bigint,
                             idagence bigint,
                             idadresse bigint,
                             idfacture_type bigint,
                             idfacture_categorie bigint,
                             montant_ht numeric(24,2) DEFAULT 0,
                             montant_ttc numeric(24,2),
                             date_facture timestamp(6) without time zone,
                             idfacture_acompte bigint,
                             iddevis bigint,
                             idsite bigint DEFAULT 0,
                             idintervention bigint,
                             idtype_devise bigint,
                             prise_contrat boolean,
                             num_devis_papier bigint
);


ALTER TABLE sav.facture OWNER TO frisquet;

--
-- TOC entry 6726 (class 0 OID 0)
-- Dependencies: 372
-- Name: COLUMN facture.prise_contrat; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.facture.prise_contrat IS 'Remplit que si facture catégorie = intervention';


--
-- TOC entry 373 (class 1259 OID 1510027)
-- Name: facture_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.facture_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.facture_id_seq OWNER TO frisquet;

--
-- TOC entry 6727 (class 0 OID 0)
-- Dependencies: 373
-- Name: facture_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.facture_id_seq OWNED BY sav.facture.id;


--
-- TOC entry 374 (class 1259 OID 1510029)
-- Name: facture_ligne; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture_ligne (
                                   id bigint NOT NULL,
                                   idfacture bigint,
                                   idproduit bigint,
                                   code_article character varying(15),
                                   designation character varying(100),
                                   quantite integer,
                                   pu_ht numeric(24,2) DEFAULT 0,
                                   idtaux_tva bigint DEFAULT 0,
                                   remise integer DEFAULT 0,
                                   prix_total_ht numeric(24,2),
                                   prix_total_ttc numeric(24,2),
                                   idproduit_facture_affectation bigint,
                                   motif_service character varying(200),
                                   produit_conserve_client boolean DEFAULT false,
                                   quantite_conserve_client integer
);


ALTER TABLE sav.facture_ligne OWNER TO frisquet;

--
-- TOC entry 375 (class 1259 OID 1510036)
-- Name: facture_ligne_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.facture_ligne_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.facture_ligne_id_seq OWNER TO frisquet;

--
-- TOC entry 6728 (class 0 OID 0)
-- Dependencies: 375
-- Name: facture_ligne_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.facture_ligne_id_seq OWNED BY sav.facture_ligne.id;


--
-- TOC entry 376 (class 1259 OID 1510038)
-- Name: facture_relance; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture_relance (
                                     id bigint NOT NULL,
                                     idfacture bigint,
                                     date_relance timestamp(6) without time zone
);


ALTER TABLE sav.facture_relance OWNER TO frisquet;

--
-- TOC entry 377 (class 1259 OID 1510041)
-- Name: facture_relance_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.facture_relance_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.facture_relance_id_seq OWNER TO frisquet;

--
-- TOC entry 6729 (class 0 OID 0)
-- Dependencies: 377
-- Name: facture_relance_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.facture_relance_id_seq OWNED BY sav.facture_relance.id;


--
-- TOC entry 378 (class 1259 OID 1510043)
-- Name: facture_tva; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture_tva (
                                 idfacture bigint NOT NULL,
                                 idtaux_tva bigint NOT NULL,
                                 montant_tva numeric(24,2) NOT NULL
);


ALTER TABLE sav.facture_tva OWNER TO frisquet;

--
-- TOC entry 379 (class 1259 OID 1510046)
-- Name: facture_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.facture_type (
                                  id integer NOT NULL,
                                  libelle_court character varying(2),
                                  libelle_long character varying(30)
);


ALTER TABLE sav.facture_type OWNER TO frisquet;

--
-- TOC entry 380 (class 1259 OID 1510049)
-- Name: facture_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.facture_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.facture_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6730 (class 0 OID 0)
-- Dependencies: 380
-- Name: facture_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.facture_type_id_seq OWNED BY sav.facture_type.id;


--
-- TOC entry 381 (class 1259 OID 1510051)
-- Name: famille_agi; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.famille_agi (
                                 id integer NOT NULL,
                                 libelle character varying(30)
);


ALTER TABLE sav.famille_agi OWNER TO frisquet;

--
-- TOC entry 382 (class 1259 OID 1510054)
-- Name: famille_agi_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.famille_agi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.famille_agi_id_seq OWNER TO frisquet;

--
-- TOC entry 6731 (class 0 OID 0)
-- Dependencies: 382
-- Name: famille_agi_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.famille_agi_id_seq OWNED BY sav.famille_agi.id;


--
-- TOC entry 383 (class 1259 OID 1510056)
-- Name: formation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.formation (
                               id integer NOT NULL,
                               libelle_court character varying(20),
                               libelle_long character varying(80),
                               actif boolean DEFAULT true
);


ALTER TABLE sav.formation OWNER TO frisquet;

--
-- TOC entry 384 (class 1259 OID 1510060)
-- Name: formation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.formation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.formation_id_seq OWNER TO frisquet;

--
-- TOC entry 6732 (class 0 OID 0)
-- Dependencies: 384
-- Name: formation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.formation_id_seq OWNED BY sav.formation.id;


--
-- TOC entry 385 (class 1259 OID 1510062)
-- Name: groupe; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.groupe (
                            id bigint NOT NULL,
                            nom character varying(50),
                            idgroupe_type bigint,
                            idsite bigint,
                            idutilisateur_admin_groupe bigint,
                            actif boolean DEFAULT true
);


ALTER TABLE sav.groupe OWNER TO frisquet;

--
-- TOC entry 386 (class 1259 OID 1510066)
-- Name: groupe_droit_portail_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.groupe_droit_portail_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.groupe_droit_portail_id_seq OWNER TO frisquet;

--
-- TOC entry 387 (class 1259 OID 1510068)
-- Name: groupe_droit_portail; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.groupe_droit_portail (
                                          id integer DEFAULT nextval('sav.groupe_droit_portail_id_seq'::regclass) NOT NULL,
                                          libelle character varying(100) NOT NULL
);


ALTER TABLE sav.groupe_droit_portail OWNER TO frisquet;

--
-- TOC entry 388 (class 1259 OID 1510072)
-- Name: groupe_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.groupe_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.groupe_id_seq OWNER TO frisquet;

--
-- TOC entry 6733 (class 0 OID 0)
-- Dependencies: 388
-- Name: groupe_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.groupe_id_seq OWNED BY sav.groupe.id;


--
-- TOC entry 389 (class 1259 OID 1510074)
-- Name: groupe_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.groupe_type (
                                 id integer NOT NULL,
                                 libelle character varying(50)
);


ALTER TABLE sav.groupe_type OWNER TO frisquet;

--
-- TOC entry 390 (class 1259 OID 1510077)
-- Name: groupe_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.groupe_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.groupe_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6734 (class 0 OID 0)
-- Dependencies: 390
-- Name: groupe_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.groupe_type_id_seq OWNED BY sav.groupe_type.id;


--
-- TOC entry 391 (class 1259 OID 1510079)
-- Name: groupe_utilisateur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.groupe_utilisateur (
                                        idutilisateur bigint DEFAULT 0 NOT NULL,
                                        idgroupe bigint DEFAULT 0 NOT NULL,
                                        notification boolean DEFAULT true,
                                        iddernier_message_lu bigint,
                                        date_dernier_message_lu timestamp with time zone
);


ALTER TABLE sav.groupe_utilisateur OWNER TO frisquet;

--
-- TOC entry 392 (class 1259 OID 1510085)
-- Name: historique_client_equipement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.historique_client_equipement (
                                                  id bigint NOT NULL,
                                                  idclient bigint DEFAULT 0,
                                                  idsouscripteur bigint DEFAULT 0,
                                                  idequipement bigint DEFAULT 0,
                                                  idintervention bigint,
                                                  date_debut date,
                                                  date_fin date
);


ALTER TABLE sav.historique_client_equipement OWNER TO frisquet;

--
-- TOC entry 393 (class 1259 OID 1510091)
-- Name: historique_client_equipement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.historique_client_equipement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.historique_client_equipement_id_seq OWNER TO frisquet;

--
-- TOC entry 6735 (class 0 OID 0)
-- Dependencies: 393
-- Name: historique_client_equipement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.historique_client_equipement_id_seq OWNED BY sav.historique_client_equipement.id;


--
-- TOC entry 394 (class 1259 OID 1510093)
-- Name: historique_equipement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.historique_equipement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.historique_equipement_id_seq OWNER TO frisquet;

--
-- TOC entry 395 (class 1259 OID 1510095)
-- Name: historique_equipement_local; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.historique_equipement_local (
                                                 id bigint DEFAULT nextval('sav.historique_equipement_id_seq'::regclass) NOT NULL,
                                                 idequipement bigint NOT NULL,
                                                 idequipement_local bigint,
                                                 idintervention bigint,
                                                 date_heure timestamp without time zone NOT NULL,
                                                 idutilisateur_modif bigint NOT NULL
);


ALTER TABLE sav.historique_equipement_local OWNER TO frisquet;

--
-- TOC entry 396 (class 1259 OID 1510099)
-- Name: historique_equipement_local_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.historique_equipement_local_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.historique_equipement_local_id_seq OWNER TO frisquet;

--
-- TOC entry 6736 (class 0 OID 0)
-- Dependencies: 396
-- Name: historique_equipement_local_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.historique_equipement_local_id_seq OWNED BY sav.historique_equipement_local.id;


--
-- TOC entry 397 (class 1259 OID 1510101)
-- Name: historique_equipement_utilisateur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.historique_equipement_utilisateur (
                                                       id bigint NOT NULL,
                                                       idequipement bigint NOT NULL,
                                                       idutilisateur bigint,
                                                       date_heure timestamp without time zone NOT NULL,
                                                       idutilisateur_modif bigint NOT NULL,
                                                       commentaire character varying(200)
);


ALTER TABLE sav.historique_equipement_utilisateur OWNER TO frisquet;

--
-- TOC entry 398 (class 1259 OID 1510104)
-- Name: historique_equipement_utilisateur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.historique_equipement_utilisateur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.historique_equipement_utilisateur_id_seq OWNER TO frisquet;

--
-- TOC entry 6737 (class 0 OID 0)
-- Dependencies: 398
-- Name: historique_equipement_utilisateur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.historique_equipement_utilisateur_id_seq OWNED BY sav.historique_equipement_utilisateur.id;


--
-- TOC entry 399 (class 1259 OID 1510106)
-- Name: historique_modification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.historique_modification (
                                             id bigint NOT NULL,
                                             idequipement bigint,
                                             idintervention bigint,
                                             idclient bigint DEFAULT 0,
                                             idagent bigint DEFAULT 0,
                                             nom_table character varying(50),
                                             nom_champ character varying(50),
                                             idutilisateur_modif bigint DEFAULT 0,
                                             origine character varying(20),
                                             date_heure timestamp(6) without time zone,
                                             avant character varying(500),
                                             apres character varying(500),
                                             effectuee boolean DEFAULT false,
                                             idutilisateur_valide bigint,
                                             date_heure_valide timestamp(6) without time zone
);


ALTER TABLE sav.historique_modification OWNER TO frisquet;

--
-- TOC entry 400 (class 1259 OID 1510116)
-- Name: historique_modification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.historique_modification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.historique_modification_id_seq OWNER TO frisquet;

--
-- TOC entry 6738 (class 0 OID 0)
-- Dependencies: 400
-- Name: historique_modification_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.historique_modification_id_seq OWNED BY sav.historique_modification.id;


--
-- TOC entry 401 (class 1259 OID 1510118)
-- Name: horaire_passage_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.horaire_passage_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.horaire_passage_id_seq OWNER TO frisquet;

--
-- TOC entry 402 (class 1259 OID 1510120)
-- Name: horaire_passage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.horaire_passage (
                                     id smallint DEFAULT nextval('sav.horaire_passage_id_seq'::regclass) NOT NULL,
                                     heure_debut time without time zone,
                                     heure_fin time without time zone,
                                     actif boolean,
                                     idsite smallint
);


ALTER TABLE sav.horaire_passage OWNER TO frisquet;

--
-- TOC entry 403 (class 1259 OID 1510124)
-- Name: installateur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.installateur (
                                  id bigint NOT NULL,
                                  code_agi character varying(9),
                                  nom character varying(30),
                                  adresse1 character varying(35) DEFAULT '0'::character varying,
                                  adresse2 character varying(35),
                                  code_postal character varying(5),
                                  ville character varying(50),
                                  tel1 character varying(14),
                                  tel2 character varying(14),
                                  email character varying(260),
                                  gere_sav boolean DEFAULT false
);


ALTER TABLE sav.installateur OWNER TO frisquet;

--
-- TOC entry 404 (class 1259 OID 1510129)
-- Name: installateur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.installateur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.installateur_id_seq OWNER TO frisquet;

--
-- TOC entry 6739 (class 0 OID 0)
-- Dependencies: 404
-- Name: installateur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.installateur_id_seq OWNED BY sav.installateur.id;


--
-- TOC entry 405 (class 1259 OID 1510131)
-- Name: intervention; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention (
                                  id bigint NOT NULL,
                                  idplanning bigint,
                                  idequipement bigint,
                                  idclient_payeur_tiers bigint,
                                  num_bon_commande character varying(200),
                                  avis_passage boolean,
                                  avis_passage_mail boolean DEFAULT false,
                                  memo character varying(200),
                                  temps smallint,
                                  idintervention_motif bigint DEFAULT 0,
                                  horaire_a_controler boolean,
                                  mesure_co smallint,
                                  observations text,
                                  cgv_acceptees boolean,
                                  commentaire_client text,
                                  idtype_envoi_rapport bigint,
                                  motif_modif_code_int character varying(200),
                                  cli_refus_signature boolean DEFAULT false,
                                  commentaire_refus_signature character varying(200),
                                  fiche_papier_liee integer,
                                  idcontrat_tarif bigint,
                                  encaissement_effectue smallint,
                                  idtype_planification bigint DEFAULT 0,
                                  idutilisateur_validation_technique bigint,
                                  date_validation_technique timestamp(6) without time zone,
                                  idtype_validation_technique bigint,
                                  commentaire_technique text,
                                  idutilisateur_validation_adm bigint,
                                  date_validation_adm timestamp(6) without time zone,
                                  idtype_validation_adm bigint,
                                  entretien boolean,
                                  idsite bigint,
                                  idtype_visite_intervention bigint,
                                  stack bytea,
                                  idattestation_entretien bigint,
                                  idretour bigint,
                                  marque_appareil character varying(50),
                                  modele_appareil character varying(50),
                                  email_envoi_rapport character varying(150),
                                  date_dernier_controle_etancheite date,
                                  fuite boolean,
                                  fuite_nb integer,
                                  reparation public.reparation,
                                  cerfa boolean,
                                  envoi_facture boolean DEFAULT false,
                                  numfiche_oracle bigint
);


ALTER TABLE sav.intervention OWNER TO frisquet;

--
-- TOC entry 406 (class 1259 OID 1510142)
-- Name: intervention_annulation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_annulation (
                                             id bigint NOT NULL,
                                             idintervention bigint DEFAULT 0,
                                             idintervention_motif_annulation bigint,
                                             idintervention_motif_absence integer,
                                             autre_motif text,
                                             observations text,
                                             idintervention_motif_abandon bigint
);


ALTER TABLE sav.intervention_annulation OWNER TO frisquet;

--
-- TOC entry 407 (class 1259 OID 1510149)
-- Name: intervention_annulation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_annulation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.intervention_annulation_id_seq OWNER TO frisquet;

--
-- TOC entry 6740 (class 0 OID 0)
-- Dependencies: 407
-- Name: intervention_annulation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_annulation_id_seq OWNED BY sav.intervention_annulation.id;


--
-- TOC entry 408 (class 1259 OID 1510151)
-- Name: intervention_anomalie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_anomalie (
                                           id bigint NOT NULL,
                                           idintervention bigint NOT NULL,
                                           idanomalie bigint,
                                           idanomalie_oracle bigint,
                                           CONSTRAINT chk_one_anomalie CHECK ((((idanomalie IS NOT NULL) AND (idanomalie_oracle IS NULL)) OR ((idanomalie IS NULL) AND (idanomalie_oracle IS NOT NULL))))
);


ALTER TABLE sav.intervention_anomalie OWNER TO frisquet;

--
-- TOC entry 409 (class 1259 OID 1510155)
-- Name: intervention_document; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_document (
                                           id bigint NOT NULL,
                                           idintervention bigint DEFAULT 0,
                                           nom character varying(100),
                                           exclusif_courrier boolean DEFAULT false,
                                           chemin character varying(150)
);


ALTER TABLE sav.intervention_document OWNER TO frisquet;

--
-- TOC entry 410 (class 1259 OID 1510160)
-- Name: intervention_document_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_document_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_document_id_seq OWNER TO frisquet;

--
-- TOC entry 6741 (class 0 OID 0)
-- Dependencies: 410
-- Name: intervention_document_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_document_id_seq OWNED BY sav.intervention_document.id;


--
-- TOC entry 411 (class 1259 OID 1510162)
-- Name: intervention_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_id_seq OWNER TO frisquet;

--
-- TOC entry 6742 (class 0 OID 0)
-- Dependencies: 411
-- Name: intervention_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_id_seq OWNED BY sav.intervention.id;


--
-- TOC entry 412 (class 1259 OID 1510164)
-- Name: intervention_media; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_media (
                                        id bigint NOT NULL,
                                        idintervention bigint DEFAULT 0,
                                        media bytea,
                                        commentaire text
);


ALTER TABLE sav.intervention_media OWNER TO frisquet;

--
-- TOC entry 413 (class 1259 OID 1510171)
-- Name: intervention_media_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_media_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_media_id_seq OWNER TO frisquet;

--
-- TOC entry 6743 (class 0 OID 0)
-- Dependencies: 413
-- Name: intervention_media_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_media_id_seq OWNED BY sav.intervention_media.id;


--
-- TOC entry 414 (class 1259 OID 1510173)
-- Name: intervention_message_co; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_message_co (
                                             id bigint NOT NULL,
                                             valeur_min integer DEFAULT 0,
                                             valeur_max integer DEFAULT 0,
                                             message character varying(256)
);


ALTER TABLE sav.intervention_message_co OWNER TO frisquet;

--
-- TOC entry 415 (class 1259 OID 1510178)
-- Name: intervention_message_co_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_message_co_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_message_co_id_seq OWNER TO frisquet;

--
-- TOC entry 6744 (class 0 OID 0)
-- Dependencies: 415
-- Name: intervention_message_co_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_message_co_id_seq OWNED BY sav.intervention_message_co.id;


--
-- TOC entry 416 (class 1259 OID 1510180)
-- Name: intervention_mesure; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_mesure (
                                         idintervention bigint NOT NULL,
                                         idtype_mesure bigint NOT NULL,
                                         valeur numeric(10,2) NOT NULL
);


ALTER TABLE sav.intervention_mesure OWNER TO frisquet;

--
-- TOC entry 417 (class 1259 OID 1510183)
-- Name: intervention_motif; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_motif (
                                        id integer NOT NULL,
                                        libelle character varying(30)
);


ALTER TABLE sav.intervention_motif OWNER TO frisquet;

--
-- TOC entry 418 (class 1259 OID 1510186)
-- Name: intervention_motif_abandon; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_motif_abandon (
                                                id integer NOT NULL,
                                                libelle character varying(50),
                                                actif boolean DEFAULT true
);


ALTER TABLE sav.intervention_motif_abandon OWNER TO frisquet;

--
-- TOC entry 419 (class 1259 OID 1510190)
-- Name: intervention_motif_abandon_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_motif_abandon_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_motif_abandon_id_seq OWNER TO frisquet;

--
-- TOC entry 6745 (class 0 OID 0)
-- Dependencies: 419
-- Name: intervention_motif_abandon_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_motif_abandon_id_seq OWNED BY sav.intervention_motif_abandon.id;


--
-- TOC entry 420 (class 1259 OID 1510192)
-- Name: intervention_motif_absence; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_motif_absence (
                                                id integer NOT NULL,
                                                libelle character varying(50),
                                                actif boolean DEFAULT true
);


ALTER TABLE sav.intervention_motif_absence OWNER TO frisquet;

--
-- TOC entry 421 (class 1259 OID 1510196)
-- Name: intervention_motif_absence_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_motif_absence_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER SEQUENCE sav.intervention_motif_absence_id_seq OWNER TO frisquet;

--
-- TOC entry 6746 (class 0 OID 0)
-- Dependencies: 421
-- Name: intervention_motif_absence_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_motif_absence_id_seq OWNED BY sav.intervention_motif_absence.id;


--
-- TOC entry 422 (class 1259 OID 1510198)
-- Name: intervention_motif_annulation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_motif_annulation (
                                                   id integer NOT NULL,
                                                   libelle_court character varying(20),
                                                   libelle_long character varying(50)
);


ALTER TABLE sav.intervention_motif_annulation OWNER TO frisquet;

--
-- TOC entry 423 (class 1259 OID 1510201)
-- Name: intervention_motif_annulation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_motif_annulation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_motif_annulation_id_seq OWNER TO frisquet;

--
-- TOC entry 6747 (class 0 OID 0)
-- Dependencies: 423
-- Name: intervention_motif_annulation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_motif_annulation_id_seq OWNED BY sav.intervention_motif_annulation.id;


--
-- TOC entry 424 (class 1259 OID 1510203)
-- Name: intervention_motif_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_motif_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_motif_id_seq OWNER TO frisquet;

--
-- TOC entry 6748 (class 0 OID 0)
-- Dependencies: 424
-- Name: intervention_motif_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_motif_id_seq OWNED BY sav.intervention_motif.id;


--
-- TOC entry 425 (class 1259 OID 1510205)
-- Name: intervention_pre_encaissement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_pre_encaissement (
                                                   id bigint NOT NULL,
                                                   idintervention bigint,
                                                   idmoyen_paiement bigint DEFAULT 0,
                                                   montant_ttc numeric(24,2),
                                                   idutilisateur_reception bigint,
                                                   date_reception timestamp(6) without time zone,
                                                   idutilisateur_responsable bigint
);


ALTER TABLE sav.intervention_pre_encaissement OWNER TO frisquet;

--
-- TOC entry 426 (class 1259 OID 1510209)
-- Name: intervention_pre_encaissement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_pre_encaissement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_pre_encaissement_id_seq OWNER TO frisquet;

--
-- TOC entry 6749 (class 0 OID 0)
-- Dependencies: 426
-- Name: intervention_pre_encaissement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_pre_encaissement_id_seq OWNED BY sav.intervention_pre_encaissement.id;


--
-- TOC entry 427 (class 1259 OID 1510211)
-- Name: intervention_stack; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_stack (
                                        id bigint NOT NULL,
                                        checksum character varying(128),
                                        idagent bigint,
                                        date_heure timestamp(6) without time zone,
                                        route character varying(128),
                                        content bytea
);


ALTER TABLE sav.intervention_stack OWNER TO frisquet;

--
-- TOC entry 428 (class 1259 OID 1510217)
-- Name: intervention_stack_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_stack_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_stack_id_seq OWNER TO frisquet;

--
-- TOC entry 6750 (class 0 OID 0)
-- Dependencies: 428
-- Name: intervention_stack_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_stack_id_seq OWNED BY sav.intervention_stack.id;


--
-- TOC entry 429 (class 1259 OID 1510219)
-- Name: intervention_type_validation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_type_validation (
  id integer NOT NULL,
  libelle character varying(50),
  libelle_technique character varying(50) DEFAULT NULL::character varying,
  affichage_technique boolean DEFAULT false
);


ALTER TABLE sav.intervention_type_validation OWNER TO frisquet;

--
-- TOC entry 430 (class 1259 OID 1510222)
-- Name: intervention_type_validation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.intervention_type_validation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.intervention_type_validation_id_seq OWNER TO frisquet;

--
-- TOC entry 6751 (class 0 OID 0)
-- Dependencies: 430
-- Name: intervention_type_validation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.intervention_type_validation_id_seq OWNED BY sav.intervention_type_validation.id;


--
-- TOC entry 431 (class 1259 OID 1510224)
-- Name: jour_exceptionnel; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.jour_exceptionnel (
                                       date date NOT NULL,
                                       travaille boolean NOT NULL
);


ALTER TABLE sav.jour_exceptionnel OWNER TO frisquet;

--
-- TOC entry 6752 (class 0 OID 0)
-- Dependencies: 431
-- Name: TABLE jour_exceptionnel; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.jour_exceptionnel IS 'Permet de déterminer les samedis travaillés. \nSi un jour normalement travaillé ne l''est pas il est renseigné ici avec le flag à false.';


--
-- TOC entry 432 (class 1259 OID 1510227)
-- Name: lock_entites_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.lock_entites_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.lock_entites_id_seq OWNER TO frisquet;

--
-- TOC entry 433 (class 1259 OID 1510229)
-- Name: lock_entites; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.lock_entites (
                                  nom_entite character varying(50),
                                  id_entite bigint,
                                  date_debut timestamp without time zone,
                                  id_utilisateur bigint,
                                  id bigint DEFAULT nextval('sav.lock_entites_id_seq'::regclass) NOT NULL
);


ALTER TABLE sav.lock_entites OWNER TO frisquet;

--
-- TOC entry 434 (class 1259 OID 1510233)
-- Name: lock_entities_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.lock_entities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.lock_entities_id_seq OWNER TO frisquet;

--
-- TOC entry 435 (class 1259 OID 1510235)
-- Name: mag_commande; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_commande (
                                  id bigint DEFAULT 0 NOT NULL,
                                  idsite bigint DEFAULT 0,
                                  code_client_agi character varying(9) NOT NULL,
                                  idequipement bigint,
                                  idintervention bigint,
                                  date timestamp(6) without time zone NOT NULL,
                                  idmag_statut_commande smallint DEFAULT 0 NOT NULL,
                                  idmag_etat_commande bigint,
                                  idtype_cde smallint DEFAULT 0 NOT NULL,
                                  idsite_livraison bigint DEFAULT 0 NOT NULL,
                                  commentaires_agi character varying(200),
                                  commentaires_sav character varying(200),
                                  num_cde_agi character varying(8),
                                  info_bl character varying(35),
                                  montant_ttc numeric(24,6),
                                  idutilisateur bigint DEFAULT 0,
                                  interne boolean DEFAULT false,
                                  idagence bigint
);


ALTER TABLE sav.mag_commande OWNER TO frisquet;

--
-- TOC entry 436 (class 1259 OID 1510245)
-- Name: mag_commande_histo; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_commande_histo (
                                        id bigint NOT NULL,
                                        idmag_commande bigint,
                                        date_heure timestamp(6) without time zone,
                                        idutilisateur bigint DEFAULT 0,
                                        commentaire text,
                                        idmag_statut_commande smallint,
                                        idmag_etat_commande bigint
);


ALTER TABLE sav.mag_commande_histo OWNER TO frisquet;

--
-- TOC entry 437 (class 1259 OID 1510252)
-- Name: mag_commande_histo_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_commande_histo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_commande_histo_id_seq OWNER TO frisquet;

--
-- TOC entry 6753 (class 0 OID 0)
-- Dependencies: 437
-- Name: mag_commande_histo_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_commande_histo_id_seq OWNED BY sav.mag_commande_histo.id;


--
-- TOC entry 438 (class 1259 OID 1510254)
-- Name: mag_etat_commande; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_etat_commande (
                                       id integer NOT NULL,
                                       libelle character varying(60)
);


ALTER TABLE sav.mag_etat_commande OWNER TO frisquet;

--
-- TOC entry 439 (class 1259 OID 1510257)
-- Name: mag_etat_commande_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_etat_commande_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_etat_commande_id_seq OWNER TO frisquet;

--
-- TOC entry 6754 (class 0 OID 0)
-- Dependencies: 439
-- Name: mag_etat_commande_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_etat_commande_id_seq OWNED BY sav.mag_etat_commande.id;


--
-- TOC entry 440 (class 1259 OID 1510259)
-- Name: mag_fermeture_meaux; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_fermeture_meaux (
                                         id bigint NOT NULL,
                                         date timestamp(6) without time zone NOT NULL
);


ALTER TABLE sav.mag_fermeture_meaux OWNER TO frisquet;

--
-- TOC entry 441 (class 1259 OID 1510262)
-- Name: mag_fermeture_meaux_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_fermeture_meaux_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_fermeture_meaux_id_seq OWNER TO frisquet;

--
-- TOC entry 6755 (class 0 OID 0)
-- Dependencies: 441
-- Name: mag_fermeture_meaux_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_fermeture_meaux_id_seq OWNED BY sav.mag_fermeture_meaux.id;


--
-- TOC entry 442 (class 1259 OID 1510264)
-- Name: mag_jour_exclusion_livraison; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_jour_exclusion_livraison (
                                                  id bigint NOT NULL,
                                                  jour_exclu smallint,
                                                  idagence bigint
);


ALTER TABLE sav.mag_jour_exclusion_livraison OWNER TO frisquet;

--
-- TOC entry 443 (class 1259 OID 1510267)
-- Name: mag_jour_exclusion_livraison_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_jour_exclusion_livraison_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_jour_exclusion_livraison_id_seq OWNER TO frisquet;

--
-- TOC entry 6756 (class 0 OID 0)
-- Dependencies: 443
-- Name: mag_jour_exclusion_livraison_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_jour_exclusion_livraison_id_seq OWNED BY sav.mag_jour_exclusion_livraison.id;


--
-- TOC entry 444 (class 1259 OID 1510269)
-- Name: mag_ligne_commande; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_ligne_commande (
                                        id bigint NOT NULL,
                                        idmag_commande bigint DEFAULT 0 NOT NULL,
                                        idproduit bigint,
                                        code_produit character varying(15) NOT NULL,
                                        designation character varying(30) NOT NULL,
                                        qte_commandee bigint DEFAULT 0 NOT NULL,
                                        qte_livree bigint,
                                        prix_ht numeric(24,6) DEFAULT 0 NOT NULL,
                                        anomalie smallint DEFAULT 0
);


ALTER TABLE sav.mag_ligne_commande OWNER TO frisquet;

--
-- TOC entry 445 (class 1259 OID 1510276)
-- Name: mag_ligne_commande_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_ligne_commande_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_ligne_commande_id_seq OWNER TO frisquet;

--
-- TOC entry 6757 (class 0 OID 0)
-- Dependencies: 445
-- Name: mag_ligne_commande_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_ligne_commande_id_seq OWNED BY sav.mag_ligne_commande.id;


--
-- TOC entry 446 (class 1259 OID 1510278)
-- Name: mag_statut_commande; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_statut_commande (
                                         id bigint NOT NULL,
                                         libelle character varying(50)
);


ALTER TABLE sav.mag_statut_commande OWNER TO frisquet;

--
-- TOC entry 447 (class 1259 OID 1510281)
-- Name: mag_statut_commande_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_statut_commande_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_statut_commande_id_seq OWNER TO frisquet;

--
-- TOC entry 6758 (class 0 OID 0)
-- Dependencies: 447
-- Name: mag_statut_commande_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_statut_commande_id_seq OWNED BY sav.mag_statut_commande.id;


--
-- TOC entry 448 (class 1259 OID 1510283)
-- Name: mag_stock_mouvement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_stock_mouvement (
                                         id bigint NOT NULL,
                                         idsite bigint DEFAULT 0,
                                         idproduit bigint,
                                         type_source character varying(15),
                                         code_produit character varying(15),
                                         source smallint,
                                         type_destination character varying(15),
                                         destination smallint,
                                         quantite smallint,
                                         idutilisateur bigint,
                                         date_mouvement timestamp(6) without time zone,
                                         motif_mouvement character varying(2),
                                         commentaire character varying(200),
                                         stock_modifie character varying(50)
);


ALTER TABLE sav.mag_stock_mouvement OWNER TO frisquet;

--
-- TOC entry 449 (class 1259 OID 1510287)
-- Name: mag_stock_mouvement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_stock_mouvement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_stock_mouvement_id_seq OWNER TO frisquet;

--
-- TOC entry 6759 (class 0 OID 0)
-- Dependencies: 449
-- Name: mag_stock_mouvement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_stock_mouvement_id_seq OWNED BY sav.mag_stock_mouvement.id;


--
-- TOC entry 450 (class 1259 OID 1510289)
-- Name: mag_type_commande; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.mag_type_commande (
                                       id integer NOT NULL,
                                       libelle character varying(30)
);


ALTER TABLE sav.mag_type_commande OWNER TO frisquet;

--
-- TOC entry 451 (class 1259 OID 1510292)
-- Name: mag_type_commande_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.mag_type_commande_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.mag_type_commande_id_seq OWNER TO frisquet;

--
-- TOC entry 6760 (class 0 OID 0)
-- Dependencies: 451
-- Name: mag_type_commande_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.mag_type_commande_id_seq OWNED BY sav.mag_type_commande.id;


--
-- TOC entry 452 (class 1259 OID 1510294)
-- Name: moment_passage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.moment_passage (
                                    id integer NOT NULL,
                                    libelle character varying(8),
                                    libelle_planning character varying(2),
                                    libelle_client character varying(40),
                                    rang_tri smallint,
                                    idsite bigint
);


ALTER TABLE sav.moment_passage OWNER TO frisquet;

--
-- TOC entry 453 (class 1259 OID 1510297)
-- Name: moment_passage_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.moment_passage_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.moment_passage_id_seq OWNER TO frisquet;

--
-- TOC entry 6761 (class 0 OID 0)
-- Dependencies: 453
-- Name: moment_passage_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.moment_passage_id_seq OWNED BY sav.moment_passage.id;


--
-- TOC entry 454 (class 1259 OID 1510299)
-- Name: motif_debit_gaz; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.motif_debit_gaz (
                                     id integer NOT NULL,
                                     libelle character varying(150) NOT NULL
);


ALTER TABLE sav.motif_debit_gaz OWNER TO frisquet;

--
-- TOC entry 455 (class 1259 OID 1510302)
-- Name: motif_debit_gaz_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.motif_debit_gaz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.motif_debit_gaz_id_seq OWNER TO frisquet;

--
-- TOC entry 6762 (class 0 OID 0)
-- Dependencies: 455
-- Name: motif_debit_gaz_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.motif_debit_gaz_id_seq OWNED BY sav.motif_debit_gaz.id;


--
-- TOC entry 456 (class 1259 OID 1510304)
-- Name: motif_modif_client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.motif_modif_client (
                                        id integer NOT NULL,
                                        libelle character varying(30)
);


ALTER TABLE sav.motif_modif_client OWNER TO frisquet;

--
-- TOC entry 457 (class 1259 OID 1510307)
-- Name: motif_modif_client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.motif_modif_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.motif_modif_client_id_seq OWNER TO frisquet;

--
-- TOC entry 6763 (class 0 OID 0)
-- Dependencies: 457
-- Name: motif_modif_client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.motif_modif_client_id_seq OWNED BY sav.motif_modif_client.id;


--
-- TOC entry 458 (class 1259 OID 1510309)
-- Name: motif_temps_partiel; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.motif_temps_partiel (
                                         id integer NOT NULL,
                                         libelle character varying(30)
);


ALTER TABLE sav.motif_temps_partiel OWNER TO frisquet;

--
-- TOC entry 459 (class 1259 OID 1510312)
-- Name: motif_temps_partiel_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.motif_temps_partiel_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.motif_temps_partiel_id_seq OWNER TO frisquet;

--
-- TOC entry 6764 (class 0 OID 0)
-- Dependencies: 459
-- Name: motif_temps_partiel_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.motif_temps_partiel_id_seq OWNED BY sav.motif_temps_partiel.id;


--
-- TOC entry 460 (class 1259 OID 1510314)
-- Name: moyen_paiement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.moyen_paiement (
                                    id integer NOT NULL,
                                    libelle_court character varying(3),
                                    libelle_long character varying(30),
                                    affichage_tablette boolean DEFAULT false
);


ALTER TABLE sav.moyen_paiement OWNER TO frisquet;

--
-- TOC entry 461 (class 1259 OID 1510318)
-- Name: moyen_paiement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.moyen_paiement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.moyen_paiement_id_seq OWNER TO frisquet;

--
-- TOC entry 6765 (class 0 OID 0)
-- Dependencies: 461
-- Name: moyen_paiement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.moyen_paiement_id_seq OWNED BY sav.moyen_paiement.id;


--
-- TOC entry 462 (class 1259 OID 1510320)
-- Name: nature_gaz_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.nature_gaz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.nature_gaz_id_seq OWNER TO frisquet;

--
-- TOC entry 6766 (class 0 OID 0)
-- Dependencies: 462
-- Name: nature_gaz_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.nature_gaz_id_seq OWNED BY sav.energie.id;


--
-- TOC entry 463 (class 1259 OID 1510322)
-- Name: observation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.observation (
                                 id integer NOT NULL,
                                 texte text,
                                 rang_tri smallint DEFAULT 0
);


ALTER TABLE sav.observation OWNER TO frisquet;

--
-- TOC entry 464 (class 1259 OID 1510329)
-- Name: observation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.observation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.observation_id_seq OWNER TO frisquet;

--
-- TOC entry 6767 (class 0 OID 0)
-- Dependencies: 464
-- Name: observation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.observation_id_seq OWNED BY sav.observation.id;


--
-- TOC entry 465 (class 1259 OID 1510331)
-- Name: old_bloc_note_client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.old_bloc_note_client (
                                          id bigint NOT NULL,
                                          idequipement bigint DEFAULT 0 NOT NULL,
                                          texte character varying(20000)
);


ALTER TABLE sav.old_bloc_note_client OWNER TO frisquet;

--
-- TOC entry 466 (class 1259 OID 1510338)
-- Name: old_bloc_note_client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.old_bloc_note_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.old_bloc_note_client_id_seq OWNER TO frisquet;

--
-- TOC entry 6768 (class 0 OID 0)
-- Dependencies: 466
-- Name: old_bloc_note_client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.old_bloc_note_client_id_seq OWNED BY sav.old_bloc_note_client.id;


--
-- TOC entry 467 (class 1259 OID 1510340)
-- Name: option; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.option (
                            id bigint NOT NULL,
                            libelle_court character varying(30),
                            libelle_long character varying(100),
                            upec boolean
);


ALTER TABLE sav.option OWNER TO frisquet;

--
-- TOC entry 468 (class 1259 OID 1510343)
-- Name: option_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.option_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.option_id_seq OWNER TO frisquet;

--
-- TOC entry 6769 (class 0 OID 0)
-- Dependencies: 468
-- Name: option_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.option_id_seq OWNED BY sav.option.id;


--
-- TOC entry 469 (class 1259 OID 1510345)
-- Name: option_tarif; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.option_tarif (
                                  id bigint NOT NULL,
                                  idoption bigint,
                                  idcontrat_type bigint DEFAULT 0,
                                  tarif_ht numeric(24,2) DEFAULT 0,
                                  date_debut date,
                                  date_fin date,
                                  idcontrat_plage bigint,
                                  idequipement_type bigint
);


ALTER TABLE sav.option_tarif OWNER TO frisquet;

--
-- TOC entry 470 (class 1259 OID 1510350)
-- Name: option_tarif_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.option_tarif_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.option_tarif_id_seq OWNER TO frisquet;

--
-- TOC entry 6770 (class 0 OID 0)
-- Dependencies: 470
-- Name: option_tarif_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.option_tarif_id_seq OWNED BY sav.option_tarif.id;


--
-- TOC entry 471 (class 1259 OID 1510352)
-- Name: paiement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.paiement (
                              id bigint NOT NULL,
                              idfacture bigint,
                              idmoyen_paiement bigint,
                              montant_ttc numeric(24,2) DEFAULT 0,
                              date timestamp(6) without time zone,
                              date_previsionnelle date
);


ALTER TABLE sav.paiement OWNER TO frisquet;

--
-- TOC entry 472 (class 1259 OID 1510356)
-- Name: paiement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.paiement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.paiement_id_seq OWNER TO frisquet;

--
-- TOC entry 6771 (class 0 OID 0)
-- Dependencies: 472
-- Name: paiement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.paiement_id_seq OWNED BY sav.paiement.id;


--
-- TOC entry 473 (class 1259 OID 1510358)
-- Name: parametre; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.parametre (
                               id bigint DEFAULT 0 NOT NULL,
                               libelle character varying(80),
                               sequence bigint,
                               nom_utilisateur character varying(50),
                               valeur_alphanum character varying(200),
                               valeur_num numeric(24,6),
                               note character varying(200),
                               regroupe_param character varying(50)
);


ALTER TABLE sav.parametre OWNER TO frisquet;

--
-- TOC entry 474 (class 1259 OID 1510365)
-- Name: planning_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_id_seq OWNER TO frisquet;

--
-- TOC entry 475 (class 1259 OID 1510367)
-- Name: planning; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning (
                              id bigint DEFAULT nextval('sav.planning_id_seq'::regclass) NOT NULL,
                              idtype_planification_init bigint,
                              idutilisateur_agent bigint,
                              idutilisateur_planning bigint,
                              idequipement bigint,
                              date_creation date,
                              date date NOT NULL,
                              statut smallint,
                              heure_debut time without time zone,
                              heure_fin time without time zone,
                              rang_tri smallint,
                              idtype_duree smallint,
                              duree integer,
                              idmoment_passage smallint,
                              idhoraire_passage smallint,
                              horaire_specifie boolean NOT NULL,
                              heure_debut_specifiee time without time zone,
                              heure_fin_specifiee time without time zone,
                              code_regroup integer,
                              idplanning_initiative_type bigint,
                              idplanning_initiative_detail bigint,
                              idsite smallint
);


ALTER TABLE sav.planning OWNER TO frisquet;

--
-- TOC entry 6772 (class 0 OID 0)
-- Dependencies: 475
-- Name: TABLE planning; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning IS 'PLN_PLANNING dans ORACLE';


--
-- TOC entry 6773 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.idequipement; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.idequipement IS 'remplie si categorie_planification du type == Client';


--
-- TOC entry 6774 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.statut; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.statut IS 'const CREATED     = 0;\n    const RECEIVED    = 1;\n    const STARTED     = 2;\n    const FINISHED    = 3;\n    const CANCELED    = 4;';


--
-- TOC entry 6775 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.heure_debut; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.heure_debut IS 'Info de la tablette';


--
-- TOC entry 6776 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.heure_fin; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.heure_fin IS 'Info de la tablette';


--
-- TOC entry 6777 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.duree; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.duree IS 'duree en minutes par défaut';


--
-- TOC entry 6778 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.horaire_specifie; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.horaire_specifie IS 'utilité ? demander à CRG';


--
-- TOC entry 6779 (class 0 OID 0)
-- Dependencies: 475
-- Name: COLUMN planning.code_regroup; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning.code_regroup IS 'Pour intervention liées';


--
-- TOC entry 476 (class 1259 OID 1510371)
-- Name: planning_action_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_action_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_action_id_seq OWNER TO frisquet;

--
-- TOC entry 477 (class 1259 OID 1510373)
-- Name: planning_action; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_action (
                                     id integer DEFAULT nextval('sav.planning_action_id_seq'::regclass) NOT NULL,
                                     libelle character varying(50)
);


ALTER TABLE sav.planning_action OWNER TO frisquet;

--
-- TOC entry 6780 (class 0 OID 0)
-- Dependencies: 477
-- Name: TABLE planning_action; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning_action IS 'Anciennement INTERV_ACTION, utile pour l''historique des actions';


--
-- TOC entry 478 (class 1259 OID 1510377)
-- Name: planning_agent_exclusion_type_planification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_agent_exclusion_type_planification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_agent_exclusion_type_planification_id_seq OWNER TO frisquet;

--
-- TOC entry 479 (class 1259 OID 1510379)
-- Name: planning_agent_exclusion_type_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_agent_exclusion_type_planification (
                                                                 idutilisateur_agent bigint DEFAULT nextval('sav.planning_agent_exclusion_type_planification_id_seq'::regclass) NOT NULL,
                                                                 idtype_planification integer NOT NULL,
                                                                 raison text
);


ALTER TABLE sav.planning_agent_exclusion_type_planification OWNER TO frisquet;

--
-- TOC entry 480 (class 1259 OID 1510386)
-- Name: planning_banque_media_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_banque_media_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_banque_media_id_seq OWNER TO frisquet;

--
-- TOC entry 481 (class 1259 OID 1510388)
-- Name: planning_banque_media; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_banque_media (
                                           id integer DEFAULT nextval('sav.planning_banque_media_id_seq'::regclass) NOT NULL,
                                           nom character varying(50),
                                           media bytea,
                                           type_image integer
);


ALTER TABLE sav.planning_banque_media OWNER TO frisquet;

--
-- TOC entry 6781 (class 0 OID 0)
-- Dependencies: 481
-- Name: COLUMN planning_banque_media.nom; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning_banque_media.nom IS 'Pour pouvoir retrouver une image par son nom. \nA voir si nécessaire ??';


--
-- TOC entry 6782 (class 0 OID 0)
-- Dependencies: 481
-- Name: COLUMN planning_banque_media.type_image; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning_banque_media.type_image IS '1,2,3 à quoi ça correspond ?\nà voir si on le conserve, selon le degré de personnalisation';


--
-- TOC entry 482 (class 1259 OID 1510395)
-- Name: planning_blocage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_blocage (
                                      idutilisateur_agent_bloque bigint NOT NULL,
                                      date_bloquee date NOT NULL,
                                      idutilisateur_blocage bigint,
                                      date date
);


ALTER TABLE sav.planning_blocage OWNER TO frisquet;

--
-- TOC entry 6783 (class 0 OID 0)
-- Dependencies: 482
-- Name: TABLE planning_blocage; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning_blocage IS 'Lorsque le planning d''un agent est ouvert en modif, on le bloque pour éviter les conflits.';


--
-- TOC entry 6784 (class 0 OID 0)
-- Dependencies: 482
-- Name: COLUMN planning_blocage.date_bloquee; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning_blocage.date_bloquee IS 'permet d''ouvrir le planning sur d''autres jours pour l''agent';


--
-- TOC entry 6785 (class 0 OID 0)
-- Dependencies: 482
-- Name: COLUMN planning_blocage.date; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON COLUMN sav.planning_blocage.date IS 'depuis quand';


--
-- TOC entry 483 (class 1259 OID 1510398)
-- Name: planning_conflit_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_conflit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_conflit_id_seq OWNER TO frisquet;

--
-- TOC entry 484 (class 1259 OID 1510400)
-- Name: planning_conflit; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_conflit (
                                      id integer DEFAULT nextval('sav.planning_conflit_id_seq'::regclass) NOT NULL,
                                      idplanning bigint
);


ALTER TABLE sav.planning_conflit OWNER TO frisquet;

--
-- TOC entry 6786 (class 0 OID 0)
-- Dependencies: 484
-- Name: TABLE planning_conflit; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning_conflit IS 'Permet de signaler quand par exemple une maladie superpose des interventions.';


--
-- TOC entry 485 (class 1259 OID 1510404)
-- Name: planning_historique_modification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_historique_modification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_historique_modification_id_seq OWNER TO frisquet;

--
-- TOC entry 486 (class 1259 OID 1510406)
-- Name: planning_historique_modification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_historique_modification (
                                                      id bigint DEFAULT nextval('sav.planning_historique_modification_id_seq'::regclass) NOT NULL,
                                                      idplanning bigint,
                                                      idplanning_action integer,
                                                      idequipement bigint,
                                                      idutilisateur_agent bigint,
                                                      idutilisateur_planning bigint,
                                                      idtype_planification bigint,
                                                      date date,
                                                      memo character varying(200),
                                                      idmoment_passage integer,
                                                      idhoraire_passage integer,
                                                      idplanning_initiative_type smallint,
                                                      idplanning_initiative_detail smallint,
                                                      date_action timestamp without time zone,
                                                      idutilisateur bigint,
                                                      avis_passage boolean,
                                                      avis_passage_mail boolean
);


ALTER TABLE sav.planning_historique_modification OWNER TO frisquet;

--
-- TOC entry 487 (class 1259 OID 1510410)
-- Name: planning_initiative_detail_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_initiative_detail_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_initiative_detail_id_seq OWNER TO frisquet;

--
-- TOC entry 488 (class 1259 OID 1510412)
-- Name: planning_initiative_detail; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_initiative_detail (
                                                id integer DEFAULT nextval('sav.planning_initiative_detail_id_seq'::regclass) NOT NULL,
                                                idplanning_initiative_type bigint,
                                                nom character varying(50),
                                                prenom character varying(50),
                                                societe character varying(50),
                                                actif boolean
);


ALTER TABLE sav.planning_initiative_detail OWNER TO frisquet;

--
-- TOC entry 6787 (class 0 OID 0)
-- Dependencies: 488
-- Name: TABLE planning_initiative_detail; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning_initiative_detail IS 'Correspond à la liste proposé pour l''initiave Installateur, commercial ou siège.';


--
-- TOC entry 489 (class 1259 OID 1510416)
-- Name: planning_initiative_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.planning_initiative_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.planning_initiative_type_id_seq OWNER TO frisquet;

--
-- TOC entry 490 (class 1259 OID 1510418)
-- Name: planning_initiative_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_initiative_type (
                                              id smallint DEFAULT nextval('sav.planning_initiative_type_id_seq'::regclass) NOT NULL,
                                              libelle character varying(50),
                                              actif boolean
);


ALTER TABLE sav.planning_initiative_type OWNER TO frisquet;

--
-- TOC entry 6788 (class 0 OID 0)
-- Dependencies: 490
-- Name: TABLE planning_initiative_type; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.planning_initiative_type IS 'installateur, commercial,siège, client (nouveau), sav (nouveau).';


--
-- TOC entry 491 (class 1259 OID 1510422)
-- Name: planning_transit; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.planning_transit (
                                      idplanning bigint NOT NULL,
                                      idutilisateur bigint,
                                      date date,
                                      lock boolean
);


ALTER TABLE sav.planning_transit OWNER TO frisquet;

--
-- TOC entry 492 (class 1259 OID 1510425)
-- Name: point_controle; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.point_controle (
                                    id integer NOT NULL,
                                    libelle character varying(250),
                                    valeur_defaut character varying(50),
                                    valeurs_possible json,
                                    obligatoire boolean,
                                    pac boolean
);


ALTER TABLE sav.point_controle OWNER TO frisquet;

--
-- TOC entry 493 (class 1259 OID 1510431)
-- Name: point_controle_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.point_controle_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.point_controle_id_seq OWNER TO frisquet;

--
-- TOC entry 6789 (class 0 OID 0)
-- Dependencies: 493
-- Name: point_controle_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.point_controle_id_seq OWNED BY sav.point_controle.id;


--
-- TOC entry 494 (class 1259 OID 1510433)
-- Name: porte_ouverte_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.porte_ouverte_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.porte_ouverte_id_seq OWNER TO frisquet;

--
-- TOC entry 495 (class 1259 OID 1510435)
-- Name: porte_ouverte; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.porte_ouverte (
                                   id bigint DEFAULT nextval('sav.porte_ouverte_id_seq'::regclass) NOT NULL,
                                   idclient bigint,
                                   idagence bigint,
                                   date date,
                                   derniere_po boolean DEFAULT true
);


ALTER TABLE sav.porte_ouverte OWNER TO frisquet;

--
-- TOC entry 496 (class 1259 OID 1510440)
-- Name: privilege; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.privilege (
                               id bigint NOT NULL,
                               idequipement bigint DEFAULT 0 NOT NULL,
                               date_candidat timestamp(6) without time zone DEFAULT CURRENT_TIMESTAMP,
                               date_proposition timestamp(6) without time zone,
                               commentaire character varying(200),
                               idprivilege_statut integer,
                               idraison_refus smallint,
                               idintervention bigint DEFAULT 0
);


ALTER TABLE sav.privilege OWNER TO frisquet;

--
-- TOC entry 497 (class 1259 OID 1510446)
-- Name: privilege_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.privilege_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.privilege_id_seq OWNER TO frisquet;

--
-- TOC entry 6790 (class 0 OID 0)
-- Dependencies: 497
-- Name: privilege_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.privilege_id_seq OWNED BY sav.privilege.id;


--
-- TOC entry 498 (class 1259 OID 1510448)
-- Name: privilege_raison_refus; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.privilege_raison_refus (
                                            id integer NOT NULL,
                                            libelle character varying(80)
);


ALTER TABLE sav.privilege_raison_refus OWNER TO frisquet;

--
-- TOC entry 499 (class 1259 OID 1510451)
-- Name: privilege_raison_refus_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.privilege_raison_refus_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.privilege_raison_refus_id_seq OWNER TO frisquet;

--
-- TOC entry 6791 (class 0 OID 0)
-- Dependencies: 499
-- Name: privilege_raison_refus_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.privilege_raison_refus_id_seq OWNED BY sav.privilege_raison_refus.id;


--
-- TOC entry 500 (class 1259 OID 1510453)
-- Name: privilege_statut; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.privilege_statut (
                                      id integer NOT NULL,
                                      libelle character varying(200)
);


ALTER TABLE sav.privilege_statut OWNER TO frisquet;

--
-- TOC entry 501 (class 1259 OID 1510456)
-- Name: privilege_statut_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.privilege_statut_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.privilege_statut_id_seq OWNER TO frisquet;

--
-- TOC entry 6792 (class 0 OID 0)
-- Dependencies: 501
-- Name: privilege_statut_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.privilege_statut_id_seq OWNED BY sav.privilege_statut.id;


--
-- TOC entry 502 (class 1259 OID 1510458)
-- Name: produit; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit (
                             id bigint NOT NULL,
                             code character varying(15) NOT NULL,
                             designation character varying(200) NOT NULL,
                             gtin character varying(48),
                             idfamille_agi bigint,
                             gu_etendue boolean,
                             idproduit_type bigint DEFAULT 0,
                             idsite bigint,
                             prix_ht numeric(24,2),
                             date_creation date,
                             date_modification date,
                             date_suppression date
);


ALTER TABLE sav.produit OWNER TO frisquet;

--
-- TOC entry 503 (class 1259 OID 1510462)
-- Name: produit_facture_affectation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_facture_affectation (
                                                 id bigint NOT NULL,
                                                 libelle_court character varying(3),
                                                 libelle_long character varying(25)
);


ALTER TABLE sav.produit_facture_affectation OWNER TO frisquet;

--
-- TOC entry 504 (class 1259 OID 1510465)
-- Name: produit_facture_affectation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_facture_affectation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_facture_affectation_id_seq OWNER TO frisquet;

--
-- TOC entry 6793 (class 0 OID 0)
-- Dependencies: 504
-- Name: produit_facture_affectation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.produit_facture_affectation_id_seq OWNED BY sav.produit_facture_affectation.id;


--
-- TOC entry 505 (class 1259 OID 1510467)
-- Name: produit_famille_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_famille_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_famille_id_seq OWNER TO frisquet;

--
-- TOC entry 506 (class 1259 OID 1510469)
-- Name: produit_famille; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_famille (
                                     id bigint DEFAULT nextval('sav.produit_famille_id_seq'::regclass) NOT NULL,
                                     commandable boolean DEFAULT false,
                                     idsite bigint DEFAULT 0,
                                     idfamille_agi bigint
);


ALTER TABLE sav.produit_famille OWNER TO frisquet;

--
-- TOC entry 507 (class 1259 OID 1510475)
-- Name: produit_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_id_seq OWNER TO frisquet;

--
-- TOC entry 6794 (class 0 OID 0)
-- Dependencies: 507
-- Name: produit_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.produit_id_seq OWNED BY sav.produit.id;


--
-- TOC entry 508 (class 1259 OID 1510477)
-- Name: produit_photo; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_photo (
                                   id bigint NOT NULL,
                                   idproduit bigint,
                                   photo bytea,
                                   photo_principale boolean DEFAULT false,
                                   nom character varying(100)
);


ALTER TABLE sav.produit_photo OWNER TO frisquet;

--
-- TOC entry 509 (class 1259 OID 1510484)
-- Name: produit_photo_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_photo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_photo_id_seq OWNER TO frisquet;

--
-- TOC entry 6795 (class 0 OID 0)
-- Dependencies: 509
-- Name: produit_photo_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.produit_photo_id_seq OWNED BY sav.produit_photo.id;


--
-- TOC entry 510 (class 1259 OID 1510486)
-- Name: produit_prestation_tarif; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_prestation_tarif (
                                              id bigint NOT NULL,
                                              idproduit bigint,
                                              idcontrat_regroupement bigint,
                                              prix_ht numeric(24,2) DEFAULT 0,
                                              date_debut date,
                                              date_fin date,
                                              idcontrat_plage bigint
);


ALTER TABLE sav.produit_prestation_tarif OWNER TO frisquet;

--
-- TOC entry 6796 (class 0 OID 0)
-- Dependencies: 510
-- Name: TABLE produit_prestation_tarif; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.produit_prestation_tarif IS 'si contrat_regroupement est null alors c''est HORS CONTRAT';


--
-- TOC entry 511 (class 1259 OID 1510490)
-- Name: produit_prestation_tarif_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_prestation_tarif_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_prestation_tarif_id_seq OWNER TO frisquet;

--
-- TOC entry 6797 (class 0 OID 0)
-- Dependencies: 511
-- Name: produit_prestation_tarif_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.produit_prestation_tarif_id_seq OWNED BY sav.produit_prestation_tarif.id;


--
-- TOC entry 512 (class 1259 OID 1510492)
-- Name: produit_stock_site; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_stock_site (
                                        idsite bigint NOT NULL,
                                        idproduit bigint NOT NULL,
                                        visible_tablette boolean DEFAULT false,
                                        stock_mini smallint DEFAULT 0,
                                        stock_reel integer DEFAULT 0,
                                        stock_theorique integer DEFAULT 0,
                                        gere_en_stock boolean DEFAULT false,
                                        stock_reappro integer DEFAULT 0,
                                        emplacement character varying(50)
);


ALTER TABLE sav.produit_stock_site OWNER TO frisquet;

--
-- TOC entry 513 (class 1259 OID 1510501)
-- Name: produit_type; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.produit_type (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.produit_type OWNER TO frisquet;

--
-- TOC entry 514 (class 1259 OID 1510504)
-- Name: produit_type_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.produit_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.produit_type_id_seq OWNER TO frisquet;

--
-- TOC entry 6798 (class 0 OID 0)
-- Dependencies: 514
-- Name: produit_type_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.produit_type_id_seq OWNED BY sav.produit_type.id;


--
-- TOC entry 515 (class 1259 OID 1510506)
-- Name: protection_sanitaire; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.protection_sanitaire (
                                          id integer NOT NULL,
                                          libelle character varying(30)
);


ALTER TABLE sav.protection_sanitaire OWNER TO frisquet;

--
-- TOC entry 516 (class 1259 OID 1510509)
-- Name: protection_sanitaire_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.protection_sanitaire_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.protection_sanitaire_id_seq OWNER TO frisquet;

--
-- TOC entry 6799 (class 0 OID 0)
-- Dependencies: 516
-- Name: protection_sanitaire_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.protection_sanitaire_id_seq OWNED BY sav.protection_sanitaire.id;


--
-- TOC entry 517 (class 1259 OID 1510511)
-- Name: raccordement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.raccordement (
                                  id integer NOT NULL,
                                  libelle character varying(50)
);


ALTER TABLE sav.raccordement OWNER TO frisquet;

--
-- TOC entry 518 (class 1259 OID 1510514)
-- Name: raccordement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.raccordement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.raccordement_id_seq OWNER TO frisquet;

--
-- TOC entry 6800 (class 0 OID 0)
-- Dependencies: 518
-- Name: raccordement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.raccordement_id_seq OWNED BY sav.raccordement.id;


--
-- TOC entry 519 (class 1259 OID 1510516)
-- Name: retour; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.retour (
                            id integer NOT NULL,
                            libelle character varying(40),
                            idtype_retour integer
);


ALTER TABLE sav.retour OWNER TO frisquet;

--
-- TOC entry 520 (class 1259 OID 1510519)
-- Name: retour_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.retour_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.retour_id_seq OWNER TO frisquet;

--
-- TOC entry 6801 (class 0 OID 0)
-- Dependencies: 520
-- Name: retour_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.retour_id_seq OWNED BY sav.retour.id;


--
-- TOC entry 521 (class 1259 OID 1510521)
-- Name: robinet_remplissage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.robinet_remplissage (
                                         id integer NOT NULL,
                                         libelle character varying(50)
);


ALTER TABLE sav.robinet_remplissage OWNER TO frisquet;

--
-- TOC entry 522 (class 1259 OID 1510524)
-- Name: robinet_remplissage_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.robinet_remplissage_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.robinet_remplissage_id_seq OWNER TO frisquet;

--
-- TOC entry 6802 (class 0 OID 0)
-- Dependencies: 522
-- Name: robinet_remplissage_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.robinet_remplissage_id_seq OWNED BY sav.robinet_remplissage.id;


--
-- TOC entry 523 (class 1259 OID 1510526)
-- Name: secteur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.secteur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.secteur_id_seq OWNER TO frisquet;

--
-- TOC entry 524 (class 1259 OID 1510528)
-- Name: secteur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur (
                             id bigint DEFAULT nextval('sav.secteur_id_seq'::regclass) NOT NULL,
                             numero integer DEFAULT 0,
                             idsectorisation_version bigint DEFAULT 0,
                             nom character varying(50),
                             idsecteur_zone bigint,
                             idsecteur_taux_retour bigint,
                             idsecteur_activite bigint,
                             coordonnees json,
                             idutilisateur_planning bigint
);


ALTER TABLE sav.secteur OWNER TO frisquet;

--
-- TOC entry 525 (class 1259 OID 1510537)
-- Name: secteur_activite; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur_activite (
                                      id bigint NOT NULL,
                                      objectif integer DEFAULT 0,
                                      libelle character varying(30)
);


ALTER TABLE sav.secteur_activite OWNER TO frisquet;

--
-- TOC entry 526 (class 1259 OID 1510541)
-- Name: secteur_activite_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.secteur_activite_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.secteur_activite_id_seq OWNER TO frisquet;

--
-- TOC entry 6803 (class 0 OID 0)
-- Dependencies: 526
-- Name: secteur_activite_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.secteur_activite_id_seq OWNED BY sav.secteur_activite.id;


--
-- TOC entry 527 (class 1259 OID 1510543)
-- Name: secteur_equipement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur_equipement (
                                        idsecteur bigint NOT NULL,
                                        idequipement bigint NOT NULL
);


ALTER TABLE sav.secteur_equipement OWNER TO frisquet;

--
-- TOC entry 528 (class 1259 OID 1510546)
-- Name: secteur_tarif; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur_tarif (
                                   id bigint NOT NULL,
                                   idsecteur_zone bigint,
                                   tarif_ht_deplacement numeric(24,2) DEFAULT 0,
                                   date_debut date,
                                   date_fin date,
                                   idproduit bigint
);


ALTER TABLE sav.secteur_tarif OWNER TO frisquet;

--
-- TOC entry 529 (class 1259 OID 1510550)
-- Name: secteur_tarif_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.secteur_tarif_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.secteur_tarif_id_seq OWNER TO frisquet;

--
-- TOC entry 6804 (class 0 OID 0)
-- Dependencies: 529
-- Name: secteur_tarif_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.secteur_tarif_id_seq OWNED BY sav.secteur_tarif.id;


--
-- TOC entry 530 (class 1259 OID 1510552)
-- Name: secteur_taux_retour; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur_taux_retour (
                                         id bigint NOT NULL,
                                         taux_retour integer DEFAULT 0,
                                         libelle character varying(30)
);


ALTER TABLE sav.secteur_taux_retour OWNER TO frisquet;

--
-- TOC entry 531 (class 1259 OID 1510556)
-- Name: secteur_taux_retour_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.secteur_taux_retour_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.secteur_taux_retour_id_seq OWNER TO frisquet;

--
-- TOC entry 6805 (class 0 OID 0)
-- Dependencies: 531
-- Name: secteur_taux_retour_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.secteur_taux_retour_id_seq OWNED BY sav.secteur_taux_retour.id;


--
-- TOC entry 532 (class 1259 OID 1510558)
-- Name: secteur_zone; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.secteur_zone (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.secteur_zone OWNER TO frisquet;

--
-- TOC entry 533 (class 1259 OID 1510561)
-- Name: secteur_zone_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.secteur_zone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.secteur_zone_id_seq OWNER TO frisquet;

--
-- TOC entry 6806 (class 0 OID 0)
-- Dependencies: 533
-- Name: secteur_zone_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.secteur_zone_id_seq OWNED BY sav.secteur_zone.id;


--
-- TOC entry 534 (class 1259 OID 1510563)
-- Name: sectorisation_version; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.sectorisation_version (
                                           id bigint NOT NULL,
                                           idsite bigint DEFAULT 0,
                                           date_debut date,
                                           date_fin date,
                                           date_modification timestamp(6) without time zone,
                                           idutilisateur bigint DEFAULT 0,
                                           commentaire text,
                                           en_prod boolean DEFAULT false
);


ALTER TABLE sav.sectorisation_version OWNER TO frisquet;

--
-- TOC entry 535 (class 1259 OID 1510572)
-- Name: sectorisation_version_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.sectorisation_version_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.sectorisation_version_id_seq OWNER TO frisquet;

--
-- TOC entry 6807 (class 0 OID 0)
-- Dependencies: 535
-- Name: sectorisation_version_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.sectorisation_version_id_seq OWNED BY sav.sectorisation_version.id;


--
-- TOC entry 536 (class 1259 OID 1510574)
-- Name: site; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.site (
                          id integer NOT NULL,
                          num smallint DEFAULT 0,
                          nom character varying(25),
                          antenne boolean DEFAULT false
);


ALTER TABLE sav.site OWNER TO frisquet;

--
-- TOC entry 537 (class 1259 OID 1510579)
-- Name: site_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.site_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.site_id_seq OWNER TO frisquet;

--
-- TOC entry 6808 (class 0 OID 0)
-- Dependencies: 537
-- Name: site_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.site_id_seq OWNED BY sav.site.id;


--
-- TOC entry 538 (class 1259 OID 1510581)
-- Name: stock_standard; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.stock_standard (
                                    id bigint NOT NULL,
                                    libelle character varying(50),
                                    idsite bigint DEFAULT 0
);


ALTER TABLE sav.stock_standard OWNER TO frisquet;

--
-- TOC entry 539 (class 1259 OID 1510585)
-- Name: stock_standard_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.stock_standard_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.stock_standard_id_seq OWNER TO frisquet;

--
-- TOC entry 6809 (class 0 OID 0)
-- Dependencies: 539
-- Name: stock_standard_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.stock_standard_id_seq OWNED BY sav.stock_standard.id;


--
-- TOC entry 540 (class 1259 OID 1510587)
-- Name: stock_standard_produit; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.stock_standard_produit (
                                            id bigint NOT NULL,
                                            idstock_standard bigint,
                                            idproduit bigint,
                                            stock_theorique integer DEFAULT 0
);


ALTER TABLE sav.stock_standard_produit OWNER TO frisquet;

--
-- TOC entry 541 (class 1259 OID 1510591)
-- Name: stock_standard_produit_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.stock_standard_produit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.stock_standard_produit_id_seq OWNER TO frisquet;

--
-- TOC entry 6810 (class 0 OID 0)
-- Dependencies: 541
-- Name: stock_standard_produit_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.stock_standard_produit_id_seq OWNED BY sav.stock_standard_produit.id;


--
-- TOC entry 542 (class 1259 OID 1510593)
-- Name: tablette_statut; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tablette_statut (
                                     id integer NOT NULL,
                                     libelle character varying(30)
);


ALTER TABLE sav.tablette_statut OWNER TO frisquet;

--
-- TOC entry 543 (class 1259 OID 1510596)
-- Name: tablette_statut_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.tablette_statut_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.tablette_statut_id_seq OWNER TO frisquet;

--
-- TOC entry 6811 (class 0 OID 0)
-- Dependencies: 543
-- Name: tablette_statut_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.tablette_statut_id_seq OWNED BY sav.tablette_statut.id;


--
-- TOC entry 544 (class 1259 OID 1510598)
-- Name: taux_tva; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.taux_tva (
                              id smallint NOT NULL,
                              taux numeric(24,2),
                              libelle character varying(20),
                              actif boolean DEFAULT true,
                              date_application date,
                              date_fin_application date,
                              id_ancien_taux_tva integer
);


ALTER TABLE sav.taux_tva OWNER TO frisquet;

--
-- TOC entry 545 (class 1259 OID 1510602)
-- Name: taux_tva_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.taux_tva_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.taux_tva_id_seq OWNER TO frisquet;

--
-- TOC entry 6812 (class 0 OID 0)
-- Dependencies: 545
-- Name: taux_tva_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.taux_tva_id_seq OWNED BY sav.taux_tva.id;


--
-- TOC entry 546 (class 1259 OID 1510604)
-- Name: tchat_message; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tchat_message (
                                   id bigint NOT NULL,
                                   idutilisateur bigint,
                                   idgroupe bigint,
                                   contenu text,
                                   date_envoi timestamp(6) without time zone NOT NULL
);


ALTER TABLE sav.tchat_message OWNER TO frisquet;

--
-- TOC entry 547 (class 1259 OID 1510610)
-- Name: tchat_message_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.tchat_message_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.tchat_message_id_seq OWNER TO frisquet;

--
-- TOC entry 6813 (class 0 OID 0)
-- Dependencies: 547
-- Name: tchat_message_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.tchat_message_id_seq OWNED BY sav.tchat_message.id;


--
-- TOC entry 548 (class 1259 OID 1510612)
-- Name: tmp_correspondance_agent; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_agent (
                                              idsite bigint NOT NULL,
                                              idutilisateur bigint NOT NULL,
                                              code_agent_oracle bigint NOT NULL
);


ALTER TABLE sav.tmp_correspondance_agent OWNER TO frisquet;

--
-- TOC entry 549 (class 1259 OID 1510615)
-- Name: tmp_correspondance_equipement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_equipement (
                                                   idsite bigint NOT NULL,
                                                   idequipement bigint NOT NULL,
                                                   idchaudiere_oracle bigint NOT NULL,
                                                   idclient bigint
);


ALTER TABLE sav.tmp_correspondance_equipement OWNER TO frisquet;

--
-- TOC entry 550 (class 1259 OID 1510618)
-- Name: tmp_correspondance_formation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_formation (
                                                  code_oracle character varying(20) NOT NULL,
                                                  idsite bigint NOT NULL,
                                                  idformation bigint
);


ALTER TABLE sav.tmp_correspondance_formation OWNER TO frisquet;

--
-- TOC entry 551 (class 1259 OID 1510621)
-- Name: tmp_correspondance_formation_organisme; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_formation_organisme (
                                                            idoracle bigint NOT NULL,
                                                            idsite bigint NOT NULL,
                                                            idpln_formation_organisme bigint
);


ALTER TABLE sav.tmp_correspondance_formation_organisme OWNER TO frisquet;

--
-- TOC entry 552 (class 1259 OID 1510624)
-- Name: tmp_correspondance_horaire_passage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_horaire_passage (
                                                        idsite bigint NOT NULL,
                                                        horaire_passage_oracle bigint NOT NULL,
                                                        idhoraire_passage bigint
);


ALTER TABLE sav.tmp_correspondance_horaire_passage OWNER TO frisquet;

--
-- TOC entry 553 (class 1259 OID 1510627)
-- Name: tmp_correspondance_intervention_planning; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_intervention_planning (
                                                              idintervention bigint NOT NULL,
                                                              idpln_planning bigint NOT NULL,
                                                              idsite bigint
);


ALTER TABLE sav.tmp_correspondance_intervention_planning OWNER TO frisquet;

--
-- TOC entry 554 (class 1259 OID 1510630)
-- Name: tmp_correspondance_moment_passage; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_moment_passage (
                                                       idsite bigint NOT NULL,
                                                       moment_passage_oracle bigint NOT NULL,
                                                       idmoment_passage bigint
);


ALTER TABLE sav.tmp_correspondance_moment_passage OWNER TO frisquet;

--
-- TOC entry 555 (class 1259 OID 1510633)
-- Name: tmp_correspondance_motif_maladie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_motif_maladie (
                                                      idoracle bigint NOT NULL,
                                                      idsite bigint NOT NULL,
                                                      idpln_motif_maladie bigint
);


ALTER TABLE sav.tmp_correspondance_motif_maladie OWNER TO frisquet;

--
-- TOC entry 556 (class 1259 OID 1510636)
-- Name: tmp_correspondance_motif_reserve; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_motif_reserve (
                                                      idoracle bigint NOT NULL,
                                                      idsite bigint NOT NULL,
                                                      idpln_motif_reserve bigint
);


ALTER TABLE sav.tmp_correspondance_motif_reserve OWNER TO frisquet;

--
-- TOC entry 557 (class 1259 OID 1510639)
-- Name: tmp_correspondance_planning; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_planning (
                                                 idsite bigint NOT NULL,
                                                 idplanning bigint NOT NULL,
                                                 idplanning_oracle bigint
);


ALTER TABLE sav.tmp_correspondance_planning OWNER TO frisquet;

--
-- TOC entry 558 (class 1259 OID 1510642)
-- Name: tmp_correspondance_reunion_lieu; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_reunion_lieu (
                                                     idoracle bigint NOT NULL,
                                                     idsite bigint NOT NULL,
                                                     idpln_reunion_lieu bigint
);


ALTER TABLE sav.tmp_correspondance_reunion_lieu OWNER TO frisquet;

--
-- TOC entry 559 (class 1259 OID 1510645)
-- Name: tmp_correspondance_reunion_ordre_jour; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_reunion_ordre_jour (
                                                           idoracle bigint NOT NULL,
                                                           idsite bigint NOT NULL,
                                                           idpln_reunion_ordre_jour bigint
);


ALTER TABLE sav.tmp_correspondance_reunion_ordre_jour OWNER TO frisquet;

--
-- TOC entry 560 (class 1259 OID 1510648)
-- Name: tmp_correspondance_voiture_lieu; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_correspondance_voiture_lieu (
                                                     idoracle bigint NOT NULL,
                                                     idsite bigint NOT NULL,
                                                     idpln_voiture_lieu bigint
);


ALTER TABLE sav.tmp_correspondance_voiture_lieu OWNER TO frisquet;

--
-- TOC entry 561 (class 1259 OID 1510651)
-- Name: tmp_sequenceur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.tmp_sequenceur (
                                    idsite bigint,
                                    annee bigint,
                                    sequenceur bigint
);


ALTER TABLE sav.tmp_sequenceur OWNER TO frisquet;

--
-- TOC entry 562 (class 1259 OID 1510654)
-- Name: type_adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_adresse (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.type_adresse OWNER TO frisquet;

--
-- TOC entry 563 (class 1259 OID 1510657)
-- Name: type_adresse_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_adresse_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_adresse_id_seq OWNER TO frisquet;

--
-- TOC entry 6814 (class 0 OID 0)
-- Dependencies: 563
-- Name: type_adresse_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_adresse_id_seq OWNED BY sav.type_adresse.id;


--
-- TOC entry 564 (class 1259 OID 1510659)
-- Name: type_appareil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_appareil (
                                   id integer NOT NULL,
                                   libelle character varying(50)
);


ALTER TABLE sav.type_appareil OWNER TO frisquet;

--
-- TOC entry 565 (class 1259 OID 1510662)
-- Name: type_appareil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_appareil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_appareil_id_seq OWNER TO frisquet;

--
-- TOC entry 6815 (class 0 OID 0)
-- Dependencies: 565
-- Name: type_appareil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_appareil_id_seq OWNED BY sav.type_appareil.id;


--
-- TOC entry 566 (class 1259 OID 1510664)
-- Name: type_client; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_client (
                                 id integer NOT NULL,
                                 libelle character varying(30)
);


ALTER TABLE sav.type_client OWNER TO frisquet;

--
-- TOC entry 567 (class 1259 OID 1510667)
-- Name: type_client_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_client_id_seq OWNER TO frisquet;

--
-- TOC entry 6816 (class 0 OID 0)
-- Dependencies: 567
-- Name: type_client_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_client_id_seq OWNED BY sav.type_client.id;


--
-- TOC entry 568 (class 1259 OID 1510669)
-- Name: type_complement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_complement (
                                     id integer NOT NULL,
                                     libelle character varying(50)
);


ALTER TABLE sav.type_complement OWNER TO frisquet;

--
-- TOC entry 569 (class 1259 OID 1510672)
-- Name: type_complement_adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_complement_adresse (
                                             id integer NOT NULL,
                                             libelle character varying(30)
);


ALTER TABLE sav.type_complement_adresse OWNER TO frisquet;

--
-- TOC entry 570 (class 1259 OID 1510675)
-- Name: type_complement_adresse_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_complement_adresse_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_complement_adresse_id_seq OWNER TO frisquet;

--
-- TOC entry 6817 (class 0 OID 0)
-- Dependencies: 570
-- Name: type_complement_adresse_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_complement_adresse_id_seq OWNED BY sav.type_complement_adresse.id;


--
-- TOC entry 571 (class 1259 OID 1510677)
-- Name: type_complement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_complement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_complement_id_seq OWNER TO frisquet;

--
-- TOC entry 6818 (class 0 OID 0)
-- Dependencies: 571
-- Name: type_complement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_complement_id_seq OWNED BY sav.type_complement.id;


--
-- TOC entry 572 (class 1259 OID 1510679)
-- Name: type_conseil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_conseil (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.type_conseil OWNER TO frisquet;

--
-- TOC entry 573 (class 1259 OID 1510682)
-- Name: type_conseil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_conseil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_conseil_id_seq OWNER TO frisquet;

--
-- TOC entry 6819 (class 0 OID 0)
-- Dependencies: 573
-- Name: type_conseil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_conseil_id_seq OWNED BY sav.type_conseil.id;


--
-- TOC entry 574 (class 1259 OID 1510684)
-- Name: type_demandeur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_demandeur (
                                    id integer NOT NULL,
                                    libelle character varying(50)
);


ALTER TABLE sav.type_demandeur OWNER TO frisquet;

--
-- TOC entry 575 (class 1259 OID 1510687)
-- Name: type_demandeur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_demandeur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_demandeur_id_seq OWNER TO frisquet;

--
-- TOC entry 6820 (class 0 OID 0)
-- Dependencies: 575
-- Name: type_demandeur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_demandeur_id_seq OWNED BY sav.type_demandeur.id;


--
-- TOC entry 576 (class 1259 OID 1510689)
-- Name: type_devise; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_devise (
                                 id integer NOT NULL,
                                 sigle character varying(2),
                                 libelle character varying(20)
);


ALTER TABLE sav.type_devise OWNER TO frisquet;

--
-- TOC entry 577 (class 1259 OID 1510692)
-- Name: type_devise_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_devise_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_devise_id_seq OWNER TO frisquet;

--
-- TOC entry 6821 (class 0 OID 0)
-- Dependencies: 577
-- Name: type_devise_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_devise_id_seq OWNED BY sav.type_devise.id;


--
-- TOC entry 578 (class 1259 OID 1510694)
-- Name: type_duree_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_duree_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_duree_id_seq OWNER TO frisquet;

--
-- TOC entry 579 (class 1259 OID 1510696)
-- Name: type_duree; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_duree (
                                id smallint DEFAULT nextval('sav.type_duree_id_seq'::regclass) NOT NULL,
                                libelle character varying(50)
);


ALTER TABLE sav.type_duree OWNER TO frisquet;

--
-- TOC entry 6822 (class 0 OID 0)
-- Dependencies: 579
-- Name: TABLE type_duree; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.type_duree IS '1 = durée définie stockée dans duree\n2 = demi-journée\n3 = journée\n4 = taille réduite au minimum (servait pour ABANDON, ABSENT et RCGV -> à supprimer ce ne sont plus des types_planification dans la refonte)';


--
-- TOC entry 580 (class 1259 OID 1510700)
-- Name: type_email; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_email (
                                id integer NOT NULL,
                                libelle character varying(50)
);


ALTER TABLE sav.type_email OWNER TO frisquet;

--
-- TOC entry 581 (class 1259 OID 1510703)
-- Name: type_email_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_email_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_email_id_seq OWNER TO frisquet;

--
-- TOC entry 6823 (class 0 OID 0)
-- Dependencies: 581
-- Name: type_email_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_email_id_seq OWNED BY sav.type_email.id;


--
-- TOC entry 582 (class 1259 OID 1510705)
-- Name: type_energie; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_energie (
                                  id integer NOT NULL,
                                  libelle character varying(30)
);


ALTER TABLE sav.type_energie OWNER TO frisquet;

--
-- TOC entry 583 (class 1259 OID 1510708)
-- Name: type_energie_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_energie_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_energie_id_seq OWNER TO frisquet;

--
-- TOC entry 6824 (class 0 OID 0)
-- Dependencies: 583
-- Name: type_energie_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_energie_id_seq OWNED BY sav.type_energie.id;


--
-- TOC entry 584 (class 1259 OID 1510710)
-- Name: type_envoi; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_envoi (
                                id integer NOT NULL,
                                libelle character varying(50)
);


ALTER TABLE sav.type_envoi OWNER TO frisquet;

--
-- TOC entry 585 (class 1259 OID 1510713)
-- Name: type_envoi_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_envoi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_envoi_id_seq OWNER TO frisquet;

--
-- TOC entry 6825 (class 0 OID 0)
-- Dependencies: 585
-- Name: type_envoi_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_envoi_id_seq OWNED BY sav.type_envoi.id;


--
-- TOC entry 586 (class 1259 OID 1510715)
-- Name: type_installation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_installation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_installation_id_seq OWNER TO frisquet;

--
-- TOC entry 587 (class 1259 OID 1510717)
-- Name: type_installation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_installation (
                                       id integer DEFAULT nextval('sav.type_installation_id_seq'::regclass) NOT NULL,
                                       libelle character varying(50)
);


ALTER TABLE sav.type_installation OWNER TO frisquet;

--
-- TOC entry 588 (class 1259 OID 1510721)
-- Name: type_logement; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_logement (
                                   id integer NOT NULL,
                                   libelle character varying(50)
);


ALTER TABLE sav.type_logement OWNER TO frisquet;

--
-- TOC entry 589 (class 1259 OID 1510724)
-- Name: type_logement_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_logement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_logement_id_seq OWNER TO frisquet;

--
-- TOC entry 6826 (class 0 OID 0)
-- Dependencies: 589
-- Name: type_logement_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_logement_id_seq OWNED BY sav.type_logement.id;


--
-- TOC entry 590 (class 1259 OID 1510726)
-- Name: type_login; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_login (
                                id integer NOT NULL,
                                libelle character varying(50)
);


ALTER TABLE sav.type_login OWNER TO frisquet;

--
-- TOC entry 591 (class 1259 OID 1510729)
-- Name: type_login_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_login_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_login_id_seq OWNER TO frisquet;

--
-- TOC entry 6827 (class 0 OID 0)
-- Dependencies: 591
-- Name: type_login_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_login_id_seq OWNED BY sav.type_login.id;


--
-- TOC entry 592 (class 1259 OID 1510731)
-- Name: type_mesure_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_mesure_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_mesure_id_seq OWNER TO frisquet;

--
-- TOC entry 593 (class 1259 OID 1510733)
-- Name: type_mesure; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_mesure (
                                 id integer DEFAULT nextval('sav.type_mesure_id_seq'::regclass) NOT NULL,
                                 libelle character varying(50),
                                 titre public.titremesure,
                                 unite public.unitemesure
);


ALTER TABLE sav.type_mesure OWNER TO frisquet;

--
-- TOC entry 594 (class 1259 OID 1510737)
-- Name: type_planification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_planification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_planification_id_seq OWNER TO frisquet;

--
-- TOC entry 595 (class 1259 OID 1510739)
-- Name: type_planification; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_planification (
                                        id integer DEFAULT nextval('sav.type_planification_id_seq'::regclass) NOT NULL,
                                        code character varying(30) NOT NULL,
                                        idcategorie_planification smallint NOT NULL,
                                        code_court character varying(3),
                                        libelle character varying(50),
                                        libelle_fact character varying(50),
                                        nb_agent smallint,
                                        idtype_duree smallint,
                                        duree smallint,
                                        couleur character varying(7),
                                        actif boolean DEFAULT true
);


ALTER TABLE sav.type_planification OWNER TO frisquet;

--
-- TOC entry 6828 (class 0 OID 0)
-- Dependencies: 595
-- Name: TABLE type_planification; Type: COMMENT; Schema: sav; Owner: frisquet
--

COMMENT ON TABLE sav.type_planification IS 'VISITE dans ORACLE';


--
-- TOC entry 596 (class 1259 OID 1510744)
-- Name: type_planification_type_appareil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_planification_type_appareil (
                                                      idtype_planification integer DEFAULT 0 NOT NULL,
                                                      idtype_appareil integer NOT NULL
);


ALTER TABLE sav.type_planification_type_appareil OWNER TO frisquet;

--
-- TOC entry 597 (class 1259 OID 1510748)
-- Name: type_retour; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_retour (
                                 id integer NOT NULL,
                                 libelle character varying(40) DEFAULT '0'::character varying
);


ALTER TABLE sav.type_retour OWNER TO frisquet;

--
-- TOC entry 598 (class 1259 OID 1510752)
-- Name: type_retour_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_retour_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_retour_id_seq OWNER TO frisquet;

--
-- TOC entry 6829 (class 0 OID 0)
-- Dependencies: 598
-- Name: type_retour_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_retour_id_seq OWNED BY sav.type_retour.id;


--
-- TOC entry 599 (class 1259 OID 1510754)
-- Name: type_tel; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_tel (
                              id integer NOT NULL,
                              libelle character varying(20)
);


ALTER TABLE sav.type_tel OWNER TO frisquet;

--
-- TOC entry 600 (class 1259 OID 1510757)
-- Name: type_tel_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_tel_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_tel_id_seq OWNER TO frisquet;

--
-- TOC entry 6830 (class 0 OID 0)
-- Dependencies: 600
-- Name: type_tel_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_tel_id_seq OWNED BY sav.type_tel.id;


--
-- TOC entry 601 (class 1259 OID 1510759)
-- Name: type_utilisateur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_utilisateur (
                                      id integer NOT NULL,
                                      libelle character varying(50)
);


ALTER TABLE sav.type_utilisateur OWNER TO frisquet;

--
-- TOC entry 602 (class 1259 OID 1510762)
-- Name: type_utilisateur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_utilisateur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_utilisateur_id_seq OWNER TO frisquet;

--
-- TOC entry 6831 (class 0 OID 0)
-- Dependencies: 602
-- Name: type_utilisateur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_utilisateur_id_seq OWNED BY sav.type_utilisateur.id;


--
-- TOC entry 603 (class 1259 OID 1510764)
-- Name: type_visite_intervention; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_visite_intervention (
                                              id integer NOT NULL,
                                              libelle character varying(50)
);


ALTER TABLE sav.type_visite_intervention OWNER TO frisquet;

--
-- TOC entry 604 (class 1259 OID 1510767)
-- Name: type_visite_intervention_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_visite_intervention_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_visite_intervention_id_seq OWNER TO frisquet;

--
-- TOC entry 6832 (class 0 OID 0)
-- Dependencies: 604
-- Name: type_visite_intervention_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_visite_intervention_id_seq OWNED BY sav.type_visite_intervention.id;


--
-- TOC entry 605 (class 1259 OID 1510769)
-- Name: type_zone; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.type_zone (
                               id integer NOT NULL,
                               libelle character varying(50)
);


ALTER TABLE sav.type_zone OWNER TO frisquet;

--
-- TOC entry 606 (class 1259 OID 1510772)
-- Name: type_zone_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.type_zone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.type_zone_id_seq OWNER TO frisquet;

--
-- TOC entry 6833 (class 0 OID 0)
-- Dependencies: 606
-- Name: type_zone_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.type_zone_id_seq OWNED BY sav.type_zone.id;


--
-- TOC entry 607 (class 1259 OID 1510774)
-- Name: utilisateur; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur (
                                 id bigint NOT NULL,
                                 nom character varying(50),
                                 prenom character varying(50),
                                 idtype_login bigint,
                                 login character varying(255),
                                 password character varying(64),
                                 cle_salage character varying(50),
                                 idtype_utilisateur smallint DEFAULT 0,
                                 url_homepage character varying(250),
                                 idutilisateur_valide_conges bigint,
                                 date_embauche date,
                                 idagence bigint,
                                 code_client_agi character varying(9),
                                 token_mobilite character varying(48),
                                 droits json,
                                 idutilisateur_role integer,
                                 role_id integer,
                                 initiales character varying(4) DEFAULT NULL::character varying,
                                 actif boolean DEFAULT true,
                                 photo bytea,
                                 code_agent character varying(20)
);


ALTER TABLE sav.utilisateur OWNER TO frisquet;

--
-- TOC entry 608 (class 1259 OID 1510783)
-- Name: utilisateur_adresse; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_adresse (
                                         idutilisateur bigint NOT NULL,
                                         idadresse bigint DEFAULT 0 NOT NULL,
                                         date_application date,
                                         actif boolean DEFAULT true
);


ALTER TABLE sav.utilisateur_adresse OWNER TO frisquet;

--
-- TOC entry 609 (class 1259 OID 1510788)
-- Name: utilisateur_affectation; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_affectation (
                                             id bigint NOT NULL,
                                             idutilisateur bigint DEFAULT 0,
                                             idutilisateur_profil bigint,
                                             idutilisateur_planning bigint,
                                             idutilisateur_responsable bigint,
                                             debut_effet timestamp(6) without time zone,
                                             fin_effet timestamp(6) without time zone,
                                             service character varying(4),
                                             est_responsable boolean DEFAULT false,
                                             planifiable boolean DEFAULT false,
                                             temps_travail integer DEFAULT 0,
                                             idmotif_temps_partiel bigint,
                                             idutilisateur_binome bigint,
                                             numero character varying(4),
                                             actif boolean
);


ALTER TABLE sav.utilisateur_affectation OWNER TO frisquet;

--
-- TOC entry 610 (class 1259 OID 1510795)
-- Name: utilisateur_affectation_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_affectation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_affectation_id_seq OWNER TO frisquet;

--
-- TOC entry 6834 (class 0 OID 0)
-- Dependencies: 610
-- Name: utilisateur_affectation_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.utilisateur_affectation_id_seq OWNED BY sav.utilisateur_affectation.id;


--
-- TOC entry 611 (class 1259 OID 1510797)
-- Name: utilisateur_email; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_email (
                                       id bigint NOT NULL,
                                       idutilisateur bigint,
                                       email character varying(260),
                                       idtype_email bigint,
                                       commentaire character varying(50)
);


ALTER TABLE sav.utilisateur_email OWNER TO frisquet;

--
-- TOC entry 612 (class 1259 OID 1510800)
-- Name: utilisateur_email_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_email_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_email_id_seq OWNER TO frisquet;

--
-- TOC entry 6835 (class 0 OID 0)
-- Dependencies: 612
-- Name: utilisateur_email_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.utilisateur_email_id_seq OWNED BY sav.utilisateur_email.id;


--
-- TOC entry 613 (class 1259 OID 1510802)
-- Name: utilisateur_filtre_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_filtre_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_filtre_id_seq OWNER TO frisquet;

--
-- TOC entry 614 (class 1259 OID 1510804)
-- Name: utilisateur_filtre; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_filtre (
                                        id bigint DEFAULT nextval('sav.utilisateur_filtre_id_seq'::regclass) NOT NULL,
                                        page character varying(100),
                                        titre character varying(255),
                                        filtre character varying(255),
                                        idutilisateur bigint,
                                        colonnes text,
                                        idutilisateur_role bigint,
                                        defaut boolean,
                                        idsite bigint,
                                        defaut_utilisateur boolean DEFAULT false
);


ALTER TABLE sav.utilisateur_filtre OWNER TO frisquet;

--
-- TOC entry 615 (class 1259 OID 1510812)
-- Name: utilisateur_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_id_seq OWNER TO frisquet;

--
-- TOC entry 6836 (class 0 OID 0)
-- Dependencies: 615
-- Name: utilisateur_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.utilisateur_id_seq OWNED BY sav.utilisateur.id;


--
-- TOC entry 616 (class 1259 OID 1510814)
-- Name: utilisateur_profil; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_profil (
                                        id bigint NOT NULL,
                                        libelle character varying(50),
                                        calcul_attachement boolean DEFAULT false
);


ALTER TABLE sav.utilisateur_profil OWNER TO frisquet;

--
-- TOC entry 617 (class 1259 OID 1510818)
-- Name: utilisateur_profil_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_profil_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_profil_id_seq OWNER TO frisquet;

--
-- TOC entry 6837 (class 0 OID 0)
-- Dependencies: 617
-- Name: utilisateur_profil_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.utilisateur_profil_id_seq OWNED BY sav.utilisateur_profil.id;


--
-- TOC entry 618 (class 1259 OID 1510820)
-- Name: utilisateur_role; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_role (
                                      id bigint NOT NULL,
                                      libelle character varying(100) NOT NULL,
                                      nom character varying(255) NOT NULL,
                                      droits json,
                                      est_responsable boolean DEFAULT false
);


ALTER TABLE sav.utilisateur_role OWNER TO frisquet;

--
-- TOC entry 619 (class 1259 OID 1510827)
-- Name: utilisateur_role_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_role_id_seq OWNER TO frisquet;

--
-- TOC entry 620 (class 1259 OID 1510829)
-- Name: utilisateur_site; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_site (
                                      idutilisateur bigint DEFAULT 0 NOT NULL,
                                      idsite bigint DEFAULT 0 NOT NULL
);


ALTER TABLE sav.utilisateur_site OWNER TO frisquet;

--
-- TOC entry 621 (class 1259 OID 1510834)
-- Name: utilisateur_tel; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.utilisateur_tel (
                                     id bigint NOT NULL,
                                     numero character varying(15),
                                     idutilisateur bigint,
                                     idtype_tel bigint DEFAULT 0,
                                     commentaire character varying(50),
                                     priorite smallint DEFAULT 0
);


ALTER TABLE sav.utilisateur_tel OWNER TO frisquet;

--
-- TOC entry 622 (class 1259 OID 1510839)
-- Name: utilisateur_tel_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.utilisateur_tel_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.utilisateur_tel_id_seq OWNER TO frisquet;

--
-- TOC entry 6838 (class 0 OID 0)
-- Dependencies: 622
-- Name: utilisateur_tel_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.utilisateur_tel_id_seq OWNED BY sav.utilisateur_tel.id;


--
-- TOC entry 621 (class 1259 OID 1510834)
-- Name: validation_technique_classification ; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.validation_technique_classification  (
                                     id bigint NOT NULL,
                                     libelle character varying(50)
);


ALTER TABLE sav.validation_technique_classification OWNER TO frisquet;

--
-- TOC entry 622 (class 1259 OID 1510839)
-- Name: validation_technique_classification_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.validation_technique_classification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.validation_technique_classification_id_seq OWNER TO frisquet;

--
-- TOC entry 6838 (class 0 OID 0)
-- Dependencies: 622
-- Name: validation_technique_classification_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.validation_technique_classification_id_seq OWNED BY sav.validation_technique_classification.id;


--
-- TOC entry 621 (class 1259 OID 1510834)
-- Name: validation_technique_pdc ; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.validation_technique_pdc (
                                                          id bigint NOT NULL,
                                                          idvalidation_technique_classification bigint NOT NULL,
                                                          annotation text,
                                                          complement text
);


ALTER TABLE sav.validation_technique_pdc OWNER TO frisquet;

--
-- TOC entry 622 (class 1259 OID 1510839)
-- Name: validation_technique_pdc_id_seq; Type: SEQUENCE; Schema: sav; Owner: frisquet
--

CREATE SEQUENCE sav.validation_technique_pdc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE sav.validation_technique_pdc_id_seq OWNER TO frisquet;

--
-- TOC entry 6838 (class 0 OID 0)
-- Dependencies: 622
-- Name: validation_technique_pdc_id_seq; Type: SEQUENCE OWNED BY; Schema: sav; Owner: frisquet
--

ALTER SEQUENCE sav.validation_technique_pdc_id_seq OWNED BY sav.validation_technique_pdc.id;
--
-- TOC entry 621 (class 1259 OID 1510834)
-- Name: intervention_validation_technique_pdc ; Type: TABLE; Schema: sav; Owner: frisquet
--

CREATE TABLE sav.intervention_validation_technique_pdc  (
                                              idintervention bigint NOT NULL,
                                              idvalidation_technique_pdc bigint NOT NULL,
                                              commentaire_si_autre text
);


ALTER TABLE sav.intervention_validation_technique_pdc OWNER TO frisquet;




--
-- TOC entry 5038 (class 2604 OID 1510841)
-- Name: adresse id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse ALTER COLUMN id SET DEFAULT nextval('sav.adresse_id_seq'::regclass);


--
-- TOC entry 5039 (class 2604 OID 1510842)
-- Name: adresse_complement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse_complement ALTER COLUMN id SET DEFAULT nextval('sav.adresse_complement_id_seq'::regclass);


--
-- TOC entry 5041 (class 2604 OID 1510843)
-- Name: agence id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence ALTER COLUMN id SET DEFAULT nextval('sav.agence_id_seq'::regclass);


--
-- TOC entry 5048 (class 2604 OID 1510844)
-- Name: agent_gps id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_gps ALTER COLUMN id SET DEFAULT nextval('sav.agent_gps_id_seq'::regclass);


--
-- TOC entry 5065 (class 2604 OID 1510845)
-- Name: aide_technique_classification_liste id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_classification_liste ALTER COLUMN id SET DEFAULT nextval('sav.aide_technique_classification_liste_id_seq'::regclass);


--
-- TOC entry 5066 (class 2604 OID 1510846)
-- Name: aide_technique_etat id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_etat ALTER COLUMN id SET DEFAULT nextval('sav.aide_technique_etat_id_seq'::regclass);


--
-- TOC entry 5067 (class 2604 OID 1510847)
-- Name: aide_technique_histo id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_histo ALTER COLUMN id SET DEFAULT nextval('sav.aide_technique_histo_id_seq'::regclass);


--
-- TOC entry 5075 (class 2604 OID 1510848)
-- Name: appareil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.appareil ALTER COLUMN id SET DEFAULT nextval('sav.appareil_id_seq'::regclass);


--
-- TOC entry 5078 (class 2604 OID 1510849)
-- Name: attachement_parametre id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_parametre ALTER COLUMN id SET DEFAULT nextval('sav.attachement_parametre_id_seq'::regclass);


--
-- TOC entry 5082 (class 2604 OID 1510850)
-- Name: attachement_parametre_liste id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_parametre_liste ALTER COLUMN id SET DEFAULT nextval('sav.attachement_parametre_liste_id_seq'::regclass);


--
-- TOC entry 5083 (class 2604 OID 1510851)
-- Name: attachement_periode_froid id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_periode_froid ALTER COLUMN id SET DEFAULT nextval('sav.attachement_periode_froid_id_seq'::regclass);


--
-- TOC entry 5087 (class 2604 OID 1510852)
-- Name: attachement_profil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_profil ALTER COLUMN id SET DEFAULT nextval('sav.attachement_profil_id_seq'::regclass);


--
-- TOC entry 5093 (class 2604 OID 1510853)
-- Name: attachement_type_planification id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_type_planification ALTER COLUMN id SET DEFAULT nextval('sav.attachement_type_planification_id_seq'::regclass);


--
-- TOC entry 5105 (class 2604 OID 1510854)
-- Name: categorie_pro id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.categorie_pro ALTER COLUMN id SET DEFAULT nextval('sav.categorie_pro_id_seq'::regclass);


--
-- TOC entry 5106 (class 2604 OID 1510855)
-- Name: cgv id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.cgv ALTER COLUMN id SET DEFAULT nextval('sav.cgv_id_seq'::regclass);


--
-- TOC entry 5108 (class 2604 OID 1510856)
-- Name: classe_rendement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classe_rendement ALTER COLUMN id SET DEFAULT nextval('sav.classe_rendement_id_seq'::regclass);


--
-- TOC entry 5109 (class 2604 OID 1510857)
-- Name: classification_energetique id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classification_energetique ALTER COLUMN id SET DEFAULT nextval('sav.classification_energetique_id_seq'::regclass);


--
-- TOC entry 5112 (class 2604 OID 1510858)
-- Name: client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client ALTER COLUMN id SET DEFAULT nextval('sav.client_id_seq'::regclass);


--
-- TOC entry 5118 (class 2604 OID 1510859)
-- Name: client_email id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_email ALTER COLUMN id SET DEFAULT nextval('sav.client_email_id_seq'::regclass);


--
-- TOC entry 5120 (class 2604 OID 1510860)
-- Name: client_tel id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_tel ALTER COLUMN id SET DEFAULT nextval('sav.client_tel_id_seq'::regclass);


--
-- TOC entry 5124 (class 2604 OID 1510861)
-- Name: communication_canal id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_canal ALTER COLUMN id SET DEFAULT nextval('sav.communication_canal_id_seq'::regclass);


--
-- TOC entry 5125 (class 2604 OID 1510862)
-- Name: communication_client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client ALTER COLUMN id SET DEFAULT nextval('sav.communication_client_id_seq'::regclass);


--
-- TOC entry 5130 (class 2604 OID 1510863)
-- Name: communication_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_type ALTER COLUMN id SET DEFAULT nextval('sav.communication_type_id_seq'::regclass);


--
-- TOC entry 5131 (class 2604 OID 1510864)
-- Name: compte_client_web id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.compte_client_web ALTER COLUMN id SET DEFAULT nextval('sav.compte_client_web_id_seq'::regclass);


--
-- TOC entry 5132 (class 2604 OID 1510865)
-- Name: conseil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.conseil ALTER COLUMN id SET DEFAULT nextval('sav.conseil_id_seq'::regclass);


--
-- TOC entry 5133 (class 2604 OID 1510866)
-- Name: contrat id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat ALTER COLUMN id SET DEFAULT nextval('sav.contrat_id_seq'::regclass);


--
-- TOC entry 5143 (class 2604 OID 1510867)
-- Name: contrat_motif_resiliation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_motif_resiliation ALTER COLUMN id SET DEFAULT nextval('sav.contrat_motif_resiliation_id_seq'::regclass);


--
-- TOC entry 5144 (class 2604 OID 1510868)
-- Name: contrat_plage id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_plage ALTER COLUMN id SET DEFAULT nextval('sav.contrat_plage_id_seq'::regclass);


--
-- TOC entry 5145 (class 2604 OID 1510869)
-- Name: contrat_proposition id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_proposition ALTER COLUMN id SET DEFAULT nextval('sav.contrat_proposition_id_seq'::regclass);


--
-- TOC entry 5148 (class 2604 OID 1510870)
-- Name: contrat_regroupement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_regroupement ALTER COLUMN id SET DEFAULT nextval('sav.contrat_regroupement_id_seq'::regclass);


--
-- TOC entry 5149 (class 2604 OID 1510871)
-- Name: contrat_relance id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_relance ALTER COLUMN id SET DEFAULT nextval('sav.contrat_relance_id_seq'::regclass);


--
-- TOC entry 5152 (class 2604 OID 1510872)
-- Name: contrat_tarif id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_tarif ALTER COLUMN id SET DEFAULT nextval('sav.contrat_tarif_id_seq'::regclass);


--
-- TOC entry 5155 (class 2604 OID 1510873)
-- Name: contrat_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_type ALTER COLUMN id SET DEFAULT nextval('sav.contrat_type_id_seq'::regclass);


--
-- TOC entry 5156 (class 2604 OID 1510874)
-- Name: courrier_client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.courrier_client ALTER COLUMN id SET DEFAULT nextval('sav.courrier_client_id_seq'::regclass);


--
-- TOC entry 5157 (class 2604 OID 1510875)
-- Name: demande_documentation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.demande_documentation ALTER COLUMN id SET DEFAULT nextval('sav.demande_documentation_id_seq'::regclass);


--
-- TOC entry 5160 (class 2604 OID 1510876)
-- Name: devis id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis ALTER COLUMN id SET DEFAULT nextval('sav.devis_id_seq'::regclass);


--
-- TOC entry 5161 (class 2604 OID 1510877)
-- Name: devis_ligne id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne ALTER COLUMN id SET DEFAULT nextval('sav.devis_ligne_id_seq'::regclass);


--
-- TOC entry 5162 (class 2604 OID 1510878)
-- Name: devis_statut id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_statut ALTER COLUMN id SET DEFAULT nextval('sav.devis_statut_id_seq'::regclass);


--
-- TOC entry 5164 (class 2604 OID 1510879)
-- Name: energie id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.energie ALTER COLUMN id SET DEFAULT nextval('sav.nature_gaz_id_seq'::regclass);


--
-- TOC entry 5166 (class 2604 OID 1510880)
-- Name: equipement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement ALTER COLUMN id SET DEFAULT nextval('sav.equipement_id_seq'::regclass);


--
-- TOC entry 5179 (class 2604 OID 1510881)
-- Name: equipement_famille_contrat id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_famille_contrat ALTER COLUMN id SET DEFAULT nextval('sav.equipement_famille_contrat_id_seq'::regclass);


--
-- TOC entry 5183 (class 2604 OID 1510882)
-- Name: equipement_groupe id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_groupe ALTER COLUMN id SET DEFAULT nextval('sav.equipement_groupe_id_seq'::regclass);


--
-- TOC entry 5188 (class 2604 OID 1510883)
-- Name: equipement_local id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_local ALTER COLUMN id SET DEFAULT nextval('sav.equipement_local_id_seq'::regclass);


--
-- TOC entry 5189 (class 2604 OID 1510884)
-- Name: equipement_marque id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_marque ALTER COLUMN id SET DEFAULT nextval('sav.equipement_marque_id_seq'::regclass);


--
-- TOC entry 5191 (class 2604 OID 1510885)
-- Name: equipement_option id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_option ALTER COLUMN id SET DEFAULT nextval('sav.equipement_option_id_seq'::regclass);


--
-- TOC entry 5201 (class 2604 OID 1510886)
-- Name: equipement_puissance id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_puissance ALTER COLUMN id SET DEFAULT nextval('sav.equipement_puissance_id_seq'::regclass);


--
-- TOC entry 5203 (class 2604 OID 1510887)
-- Name: equipement_tranche id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_tranche ALTER COLUMN id SET DEFAULT nextval('sav.equipement_tranche_id_seq'::regclass);


--
-- TOC entry 5206 (class 2604 OID 1510888)
-- Name: equipement_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type ALTER COLUMN id SET DEFAULT nextval('sav.equipement_type_id_seq'::regclass);


--
-- TOC entry 5208 (class 2604 OID 1510889)
-- Name: equipement_type_famille id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_famille ALTER COLUMN id SET DEFAULT nextval('sav.equipement_type_famille_id_seq'::regclass);


--
-- TOC entry 5209 (class 2604 OID 1510890)
-- Name: equipement_type_puissance id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_puissance ALTER COLUMN id SET DEFAULT nextval('sav.equipement_type_puissance_id_seq'::regclass);


--
-- TOC entry 5212 (class 2604 OID 1510891)
-- Name: etat_civil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.etat_civil ALTER COLUMN id SET DEFAULT nextval('sav.etat_civil_id_seq'::regclass);


--
-- TOC entry 5215 (class 2604 OID 1510892)
-- Name: facture id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture ALTER COLUMN id SET DEFAULT nextval('sav.facture_id_seq'::regclass);


--
-- TOC entry 5103 (class 2604 OID 1510893)
-- Name: facture_categorie id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_categorie ALTER COLUMN id SET DEFAULT nextval('sav.categorie_facture_id_seq'::regclass);


--
-- TOC entry 5220 (class 2604 OID 1510894)
-- Name: facture_ligne id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne ALTER COLUMN id SET DEFAULT nextval('sav.facture_ligne_id_seq'::regclass);


--
-- TOC entry 5225 (class 2604 OID 1510895)
-- Name: facture_relance id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_relance ALTER COLUMN id SET DEFAULT nextval('sav.facture_relance_id_seq'::regclass);


--
-- TOC entry 5226 (class 2604 OID 1510896)
-- Name: facture_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_type ALTER COLUMN id SET DEFAULT nextval('sav.facture_type_id_seq'::regclass);


--
-- TOC entry 5227 (class 2604 OID 1510897)
-- Name: famille_agi id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.famille_agi ALTER COLUMN id SET DEFAULT nextval('sav.famille_agi_id_seq'::regclass);


--
-- TOC entry 5228 (class 2604 OID 1510898)
-- Name: formation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.formation ALTER COLUMN id SET DEFAULT nextval('sav.formation_id_seq'::regclass);


--
-- TOC entry 5230 (class 2604 OID 1510899)
-- Name: groupe id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe ALTER COLUMN id SET DEFAULT nextval('sav.groupe_id_seq'::regclass);


--
-- TOC entry 5233 (class 2604 OID 1510900)
-- Name: groupe_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_type ALTER COLUMN id SET DEFAULT nextval('sav.groupe_type_id_seq'::regclass);


--
-- TOC entry 5237 (class 2604 OID 1510901)
-- Name: historique_client_equipement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement ALTER COLUMN id SET DEFAULT nextval('sav.historique_client_equipement_id_seq'::regclass);


--
-- TOC entry 5242 (class 2604 OID 1510902)
-- Name: historique_equipement_utilisateur id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_utilisateur ALTER COLUMN id SET DEFAULT nextval('sav.historique_equipement_utilisateur_id_seq'::regclass);


--
-- TOC entry 5243 (class 2604 OID 1510903)
-- Name: historique_modification id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification ALTER COLUMN id SET DEFAULT nextval('sav.historique_modification_id_seq'::regclass);


--
-- TOC entry 5249 (class 2604 OID 1510904)
-- Name: installateur id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.installateur ALTER COLUMN id SET DEFAULT nextval('sav.installateur_id_seq'::regclass);


--
-- TOC entry 5252 (class 2604 OID 1510905)
-- Name: intervention id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention ALTER COLUMN id SET DEFAULT nextval('sav.intervention_id_seq'::regclass);


--
-- TOC entry 5258 (class 2604 OID 1510906)
-- Name: intervention_annulation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_annulation ALTER COLUMN id SET DEFAULT nextval('sav.intervention_annulation_id_seq'::regclass);


--
-- TOC entry 5260 (class 2604 OID 1510907)
-- Name: intervention_document id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_document ALTER COLUMN id SET DEFAULT nextval('sav.intervention_document_id_seq'::regclass);


--
-- TOC entry 5263 (class 2604 OID 1510908)
-- Name: intervention_media id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_media ALTER COLUMN id SET DEFAULT nextval('sav.intervention_media_id_seq'::regclass);


--
-- TOC entry 5265 (class 2604 OID 1510909)
-- Name: intervention_message_co id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_message_co ALTER COLUMN id SET DEFAULT nextval('sav.intervention_message_co_id_seq'::regclass);


--
-- TOC entry 5268 (class 2604 OID 1510910)
-- Name: intervention_motif id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif ALTER COLUMN id SET DEFAULT nextval('sav.intervention_motif_id_seq'::regclass);


--
-- TOC entry 5269 (class 2604 OID 1510911)
-- Name: intervention_motif_abandon id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_abandon ALTER COLUMN id SET DEFAULT nextval('sav.intervention_motif_abandon_id_seq'::regclass);


--
-- TOC entry 5271 (class 2604 OID 1510912)
-- Name: intervention_motif_absence id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_absence ALTER COLUMN id SET DEFAULT nextval('sav.intervention_motif_absence_id_seq'::regclass);


--
-- TOC entry 5273 (class 2604 OID 1510913)
-- Name: intervention_motif_annulation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_annulation ALTER COLUMN id SET DEFAULT nextval('sav.intervention_motif_annulation_id_seq'::regclass);


--
-- TOC entry 5274 (class 2604 OID 1510914)
-- Name: intervention_pre_encaissement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement ALTER COLUMN id SET DEFAULT nextval('sav.intervention_pre_encaissement_id_seq'::regclass);


--
-- TOC entry 5276 (class 2604 OID 1510915)
-- Name: intervention_stack id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_stack ALTER COLUMN id SET DEFAULT nextval('sav.intervention_stack_id_seq'::regclass);


--
-- TOC entry 5277 (class 2604 OID 1510916)
-- Name: intervention_type_validation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_type_validation ALTER COLUMN id SET DEFAULT nextval('sav.intervention_type_validation_id_seq'::regclass);


--
-- TOC entry 5288 (class 2604 OID 1510917)
-- Name: mag_commande_histo id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande_histo ALTER COLUMN id SET DEFAULT nextval('sav.mag_commande_histo_id_seq'::regclass);


--
-- TOC entry 5290 (class 2604 OID 1510918)
-- Name: mag_etat_commande id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_etat_commande ALTER COLUMN id SET DEFAULT nextval('sav.mag_etat_commande_id_seq'::regclass);


--
-- TOC entry 5291 (class 2604 OID 1510919)
-- Name: mag_fermeture_meaux id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_fermeture_meaux ALTER COLUMN id SET DEFAULT nextval('sav.mag_fermeture_meaux_id_seq'::regclass);


--
-- TOC entry 5292 (class 2604 OID 1510920)
-- Name: mag_jour_exclusion_livraison id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_jour_exclusion_livraison ALTER COLUMN id SET DEFAULT nextval('sav.mag_jour_exclusion_livraison_id_seq'::regclass);


--
-- TOC entry 5293 (class 2604 OID 1510921)
-- Name: mag_ligne_commande id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_ligne_commande ALTER COLUMN id SET DEFAULT nextval('sav.mag_ligne_commande_id_seq'::regclass);


--
-- TOC entry 5298 (class 2604 OID 1510922)
-- Name: mag_statut_commande id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_statut_commande ALTER COLUMN id SET DEFAULT nextval('sav.mag_statut_commande_id_seq'::regclass);


--
-- TOC entry 5299 (class 2604 OID 1510923)
-- Name: mag_stock_mouvement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_stock_mouvement ALTER COLUMN id SET DEFAULT nextval('sav.mag_stock_mouvement_id_seq'::regclass);


--
-- TOC entry 5301 (class 2604 OID 1510924)
-- Name: mag_type_commande id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_type_commande ALTER COLUMN id SET DEFAULT nextval('sav.mag_type_commande_id_seq'::regclass);


--
-- TOC entry 5302 (class 2604 OID 1510925)
-- Name: moment_passage id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.moment_passage ALTER COLUMN id SET DEFAULT nextval('sav.moment_passage_id_seq'::regclass);


--
-- TOC entry 5303 (class 2604 OID 1510926)
-- Name: motif_debit_gaz id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_debit_gaz ALTER COLUMN id SET DEFAULT nextval('sav.motif_debit_gaz_id_seq'::regclass);


--
-- TOC entry 5304 (class 2604 OID 1510927)
-- Name: motif_modif_client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_modif_client ALTER COLUMN id SET DEFAULT nextval('sav.motif_modif_client_id_seq'::regclass);


--
-- TOC entry 5305 (class 2604 OID 1510928)
-- Name: motif_temps_partiel id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_temps_partiel ALTER COLUMN id SET DEFAULT nextval('sav.motif_temps_partiel_id_seq'::regclass);


--
-- TOC entry 5306 (class 2604 OID 1510929)
-- Name: moyen_paiement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.moyen_paiement ALTER COLUMN id SET DEFAULT nextval('sav.moyen_paiement_id_seq'::regclass);


--
-- TOC entry 5308 (class 2604 OID 1510930)
-- Name: observation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.observation ALTER COLUMN id SET DEFAULT nextval('sav.observation_id_seq'::regclass);


--
-- TOC entry 5310 (class 2604 OID 1510931)
-- Name: old_bloc_note_client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.old_bloc_note_client ALTER COLUMN id SET DEFAULT nextval('sav.old_bloc_note_client_id_seq'::regclass);


--
-- TOC entry 5312 (class 2604 OID 1510932)
-- Name: option id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option ALTER COLUMN id SET DEFAULT nextval('sav.option_id_seq'::regclass);


--
-- TOC entry 5313 (class 2604 OID 1510933)
-- Name: option_tarif id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif ALTER COLUMN id SET DEFAULT nextval('sav.option_tarif_id_seq'::regclass);


--
-- TOC entry 5316 (class 2604 OID 1510934)
-- Name: paiement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.paiement ALTER COLUMN id SET DEFAULT nextval('sav.paiement_id_seq'::regclass);


--
-- TOC entry 5327 (class 2604 OID 1510935)
-- Name: point_controle id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.point_controle ALTER COLUMN id SET DEFAULT nextval('sav.point_controle_id_seq'::regclass);


--
-- TOC entry 5330 (class 2604 OID 1510936)
-- Name: privilege id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege ALTER COLUMN id SET DEFAULT nextval('sav.privilege_id_seq'::regclass);


--
-- TOC entry 5334 (class 2604 OID 1510937)
-- Name: privilege_raison_refus id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege_raison_refus ALTER COLUMN id SET DEFAULT nextval('sav.privilege_raison_refus_id_seq'::regclass);


--
-- TOC entry 5335 (class 2604 OID 1510938)
-- Name: privilege_statut id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege_statut ALTER COLUMN id SET DEFAULT nextval('sav.privilege_statut_id_seq'::regclass);


--
-- TOC entry 5336 (class 2604 OID 1510939)
-- Name: produit id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit ALTER COLUMN id SET DEFAULT nextval('sav.produit_id_seq'::regclass);


--
-- TOC entry 5338 (class 2604 OID 1510940)
-- Name: produit_facture_affectation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_facture_affectation ALTER COLUMN id SET DEFAULT nextval('sav.produit_facture_affectation_id_seq'::regclass);


--
-- TOC entry 5342 (class 2604 OID 1510941)
-- Name: produit_photo id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_photo ALTER COLUMN id SET DEFAULT nextval('sav.produit_photo_id_seq'::regclass);


--
-- TOC entry 5344 (class 2604 OID 1510942)
-- Name: produit_prestation_tarif id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_prestation_tarif ALTER COLUMN id SET DEFAULT nextval('sav.produit_prestation_tarif_id_seq'::regclass);


--
-- TOC entry 5352 (class 2604 OID 1510943)
-- Name: produit_type id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_type ALTER COLUMN id SET DEFAULT nextval('sav.produit_type_id_seq'::regclass);


--
-- TOC entry 5353 (class 2604 OID 1510944)
-- Name: protection_sanitaire id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.protection_sanitaire ALTER COLUMN id SET DEFAULT nextval('sav.protection_sanitaire_id_seq'::regclass);


--
-- TOC entry 5354 (class 2604 OID 1510945)
-- Name: raccordement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.raccordement ALTER COLUMN id SET DEFAULT nextval('sav.raccordement_id_seq'::regclass);


--
-- TOC entry 5355 (class 2604 OID 1510946)
-- Name: retour id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.retour ALTER COLUMN id SET DEFAULT nextval('sav.retour_id_seq'::regclass);


--
-- TOC entry 5356 (class 2604 OID 1510947)
-- Name: robinet_remplissage id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.robinet_remplissage ALTER COLUMN id SET DEFAULT nextval('sav.robinet_remplissage_id_seq'::regclass);


--
-- TOC entry 5360 (class 2604 OID 1510948)
-- Name: secteur_activite id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_activite ALTER COLUMN id SET DEFAULT nextval('sav.secteur_activite_id_seq'::regclass);


--
-- TOC entry 5362 (class 2604 OID 1510949)
-- Name: secteur_tarif id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_tarif ALTER COLUMN id SET DEFAULT nextval('sav.secteur_tarif_id_seq'::regclass);


--
-- TOC entry 5364 (class 2604 OID 1510950)
-- Name: secteur_taux_retour id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_taux_retour ALTER COLUMN id SET DEFAULT nextval('sav.secteur_taux_retour_id_seq'::regclass);


--
-- TOC entry 5366 (class 2604 OID 1510951)
-- Name: secteur_zone id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_zone ALTER COLUMN id SET DEFAULT nextval('sav.secteur_zone_id_seq'::regclass);


--
-- TOC entry 5367 (class 2604 OID 1510952)
-- Name: sectorisation_version id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.sectorisation_version ALTER COLUMN id SET DEFAULT nextval('sav.sectorisation_version_id_seq'::regclass);


--
-- TOC entry 5371 (class 2604 OID 1510953)
-- Name: site id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.site ALTER COLUMN id SET DEFAULT nextval('sav.site_id_seq'::regclass);


--
-- TOC entry 5374 (class 2604 OID 1510954)
-- Name: stock_standard id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard ALTER COLUMN id SET DEFAULT nextval('sav.stock_standard_id_seq'::regclass);


--
-- TOC entry 5376 (class 2604 OID 1510955)
-- Name: stock_standard_produit id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard_produit ALTER COLUMN id SET DEFAULT nextval('sav.stock_standard_produit_id_seq'::regclass);


--
-- TOC entry 5378 (class 2604 OID 1510956)
-- Name: tablette_statut id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tablette_statut ALTER COLUMN id SET DEFAULT nextval('sav.tablette_statut_id_seq'::regclass);


--
-- TOC entry 5379 (class 2604 OID 1510957)
-- Name: taux_tva id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.taux_tva ALTER COLUMN id SET DEFAULT nextval('sav.taux_tva_id_seq'::regclass);


--
-- TOC entry 5381 (class 2604 OID 1510958)
-- Name: tchat_message id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tchat_message ALTER COLUMN id SET DEFAULT nextval('sav.tchat_message_id_seq'::regclass);


--
-- TOC entry 5382 (class 2604 OID 1510959)
-- Name: type_adresse id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_adresse ALTER COLUMN id SET DEFAULT nextval('sav.type_adresse_id_seq'::regclass);


--
-- TOC entry 5383 (class 2604 OID 1510960)
-- Name: type_appareil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_appareil ALTER COLUMN id SET DEFAULT nextval('sav.type_appareil_id_seq'::regclass);


--
-- TOC entry 5384 (class 2604 OID 1510961)
-- Name: type_client id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_client ALTER COLUMN id SET DEFAULT nextval('sav.type_client_id_seq'::regclass);


--
-- TOC entry 5385 (class 2604 OID 1510962)
-- Name: type_complement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_complement ALTER COLUMN id SET DEFAULT nextval('sav.type_complement_id_seq'::regclass);


--
-- TOC entry 5386 (class 2604 OID 1510963)
-- Name: type_complement_adresse id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_complement_adresse ALTER COLUMN id SET DEFAULT nextval('sav.type_complement_adresse_id_seq'::regclass);


--
-- TOC entry 5387 (class 2604 OID 1510964)
-- Name: type_conseil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_conseil ALTER COLUMN id SET DEFAULT nextval('sav.type_conseil_id_seq'::regclass);


--
-- TOC entry 5388 (class 2604 OID 1510965)
-- Name: type_demandeur id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_demandeur ALTER COLUMN id SET DEFAULT nextval('sav.type_demandeur_id_seq'::regclass);


--
-- TOC entry 5389 (class 2604 OID 1510966)
-- Name: type_devise id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_devise ALTER COLUMN id SET DEFAULT nextval('sav.type_devise_id_seq'::regclass);


--
-- TOC entry 5391 (class 2604 OID 1510967)
-- Name: type_email id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_email ALTER COLUMN id SET DEFAULT nextval('sav.type_email_id_seq'::regclass);


--
-- TOC entry 5392 (class 2604 OID 1510968)
-- Name: type_energie id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_energie ALTER COLUMN id SET DEFAULT nextval('sav.type_energie_id_seq'::regclass);


--
-- TOC entry 5393 (class 2604 OID 1510969)
-- Name: type_envoi id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_envoi ALTER COLUMN id SET DEFAULT nextval('sav.type_envoi_id_seq'::regclass);


--
-- TOC entry 5395 (class 2604 OID 1510970)
-- Name: type_logement id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_logement ALTER COLUMN id SET DEFAULT nextval('sav.type_logement_id_seq'::regclass);


--
-- TOC entry 5396 (class 2604 OID 1510971)
-- Name: type_login id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_login ALTER COLUMN id SET DEFAULT nextval('sav.type_login_id_seq'::regclass);


--
-- TOC entry 5401 (class 2604 OID 1510972)
-- Name: type_retour id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_retour ALTER COLUMN id SET DEFAULT nextval('sav.type_retour_id_seq'::regclass);


--
-- TOC entry 5403 (class 2604 OID 1510973)
-- Name: type_tel id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_tel ALTER COLUMN id SET DEFAULT nextval('sav.type_tel_id_seq'::regclass);


--
-- TOC entry 5404 (class 2604 OID 1510974)
-- Name: type_utilisateur id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_utilisateur ALTER COLUMN id SET DEFAULT nextval('sav.type_utilisateur_id_seq'::regclass);


--
-- TOC entry 5405 (class 2604 OID 1510975)
-- Name: type_visite_intervention id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_visite_intervention ALTER COLUMN id SET DEFAULT nextval('sav.type_visite_intervention_id_seq'::regclass);


--
-- TOC entry 5406 (class 2604 OID 1510976)
-- Name: type_zone id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_zone ALTER COLUMN id SET DEFAULT nextval('sav.type_zone_id_seq'::regclass);


--
-- TOC entry 5407 (class 2604 OID 1510977)
-- Name: utilisateur id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur ALTER COLUMN id SET DEFAULT nextval('sav.utilisateur_id_seq'::regclass);


--
-- TOC entry 5413 (class 2604 OID 1510978)
-- Name: utilisateur_affectation id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation ALTER COLUMN id SET DEFAULT nextval('sav.utilisateur_affectation_id_seq'::regclass);


--
-- TOC entry 5418 (class 2604 OID 1510979)
-- Name: utilisateur_email id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_email ALTER COLUMN id SET DEFAULT nextval('sav.utilisateur_email_id_seq'::regclass);


--
-- TOC entry 5421 (class 2604 OID 1510980)
-- Name: utilisateur_profil id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_profil ALTER COLUMN id SET DEFAULT nextval('sav.utilisateur_profil_id_seq'::regclass);


--
-- TOC entry 5426 (class 2604 OID 1510981)
-- Name: utilisateur_tel id; Type: DEFAULT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_tel ALTER COLUMN id SET DEFAULT nextval('sav.utilisateur_tel_id_seq'::regclass);


--
-- TOC entry 5439 (class 2606 OID 1510983)
-- Name: adresse_complement adresse_complement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse_complement
    ADD CONSTRAINT adresse_complement_pkey PRIMARY KEY (id);


--
-- TOC entry 5434 (class 2606 OID 1510985)
-- Name: adresse adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse
    ADD CONSTRAINT adresse_pkey PRIMARY KEY (id);


--
-- TOC entry 5445 (class 2606 OID 1510987)
-- Name: agence_adresse agence_adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence_adresse
    ADD CONSTRAINT agence_adresse_pkey PRIMARY KEY (idagence, idadresse);


--
-- TOC entry 5443 (class 2606 OID 1510989)
-- Name: agence agence_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence
    ADD CONSTRAINT agence_pkey PRIMARY KEY (id);


--
-- TOC entry 5447 (class 2606 OID 1510991)
-- Name: agent_appareil agent_appareil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_appareil
    ADD CONSTRAINT agent_appareil_pkey PRIMARY KEY (idappareil, idutilisateur_agent);


--
-- TOC entry 5451 (class 2606 OID 1510993)
-- Name: agent_gps agent_gps_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_gps
    ADD CONSTRAINT agent_gps_pkey PRIMARY KEY (id);


--
-- TOC entry 5454 (class 2606 OID 1510995)
-- Name: agent_produit_stock agent_produit_stock_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_produit_stock
    ADD CONSTRAINT agent_produit_stock_pkey PRIMARY KEY (idagent, idproduit);


--
-- TOC entry 5460 (class 2606 OID 1510997)
-- Name: agent_qualification agent_qualification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_qualification
    ADD CONSTRAINT agent_qualification_pkey PRIMARY KEY (idutilisateur_agent, idequipement_famille);


--
-- TOC entry 5464 (class 2606 OID 1510999)
-- Name: agent_restriction agent_restriction_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_restriction
    ADD CONSTRAINT agent_restriction_pkey PRIMARY KEY (idutilisateur_agent, idtype_planification);


--
-- TOC entry 5469 (class 2606 OID 1511001)
-- Name: agent_secteur agent_secteur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_secteur
    ADD CONSTRAINT agent_secteur_pkey PRIMARY KEY (idsecteur_version, idutilisateur_agent);


--
-- TOC entry 5481 (class 2606 OID 1511003)
-- Name: aide_technique_classification_liste aide_technique_classification_liste_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_classification_liste
    ADD CONSTRAINT aide_technique_classification_liste_pkey PRIMARY KEY (id);


--
-- TOC entry 5479 (class 2606 OID 1511005)
-- Name: aide_technique_classification aide_technique_classification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_classification
    ADD CONSTRAINT aide_technique_classification_pkey PRIMARY KEY (idaide_technique, idaide_technique_classification_liste);


--
-- TOC entry 5483 (class 2606 OID 1511007)
-- Name: aide_technique_etat aide_technique_etat_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_etat
    ADD CONSTRAINT aide_technique_etat_pkey PRIMARY KEY (id);


--
-- TOC entry 5485 (class 2606 OID 1511009)
-- Name: aide_technique_histo aide_technique_histo_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_histo
    ADD CONSTRAINT aide_technique_histo_pkey PRIMARY KEY (id);


--
-- TOC entry 5474 (class 2606 OID 1511011)
-- Name: aide_technique aide_technique_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique
    ADD CONSTRAINT aide_technique_pkey PRIMARY KEY (id);


--
-- TOC entry 5492 (class 2606 OID 1511013)
-- Name: anomalie_categorie anomalie_categorie_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie_categorie
    ADD CONSTRAINT anomalie_categorie_pkey PRIMARY KEY (id);


--
-- TOC entry 5494 (class 2606 OID 1511015)
-- Name: anomalie_classification anomalie_classification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie_classification
    ADD CONSTRAINT anomalie_classification_pkey PRIMARY KEY (id);


--
-- TOC entry 5496 (class 2606 OID 1511017)
-- Name: anomalie_coupure_gaz anomalie_coupure_gaz_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie_coupure_gaz
    ADD CONSTRAINT anomalie_coupure_gaz_pkey PRIMARY KEY (id);


--
-- TOC entry 5498 (class 2606 OID 1511019)
-- Name: anomalie_oracle anomalie_oracle_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie_oracle
    ADD CONSTRAINT anomalie_oracle_pkey PRIMARY KEY (id);


--
-- TOC entry 5490 (class 2606 OID 1511021)
-- Name: anomalie anomalie_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_pkey PRIMARY KEY (id);


--
-- TOC entry 5500 (class 2606 OID 1511023)
-- Name: anomalie_pro_contact anomalie_pro_contact_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie_pro_contact
    ADD CONSTRAINT anomalie_pro_contact_pkey PRIMARY KEY (id);


--
-- TOC entry 5502 (class 2606 OID 1511025)
-- Name: appareil appareil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.appareil
    ADD CONSTRAINT appareil_pkey PRIMARY KEY (id);


--
-- TOC entry 5507 (class 2606 OID 1511027)
-- Name: attachement_parametre_liste attachement_parametre_liste_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_parametre_liste
    ADD CONSTRAINT attachement_parametre_liste_pkey PRIMARY KEY (id);


--
-- TOC entry 5504 (class 2606 OID 1511029)
-- Name: attachement_parametre attachement_parametre_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_parametre
    ADD CONSTRAINT attachement_parametre_pkey PRIMARY KEY (id);


--
-- TOC entry 5509 (class 2606 OID 1511031)
-- Name: attachement_periode_froid attachement_periode_froid_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_periode_froid
    ADD CONSTRAINT attachement_periode_froid_pkey PRIMARY KEY (id);


--
-- TOC entry 5511 (class 2606 OID 1511033)
-- Name: attachement_profil attachement_profil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_profil
    ADD CONSTRAINT attachement_profil_pkey PRIMARY KEY (id);


--
-- TOC entry 5514 (class 2606 OID 1511035)
-- Name: attachement_type_planification attachement_type_planification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_type_planification
    ADD CONSTRAINT attachement_type_planification_pkey PRIMARY KEY (id);


--
-- TOC entry 5519 (class 2606 OID 1511037)
-- Name: attestation_entretien_conseil attestation_entretien_conseil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_conseil
    ADD CONSTRAINT attestation_entretien_conseil_pkey PRIMARY KEY (idattestation_entretien, idconseil);


--
-- TOC entry 5517 (class 2606 OID 1511039)
-- Name: attestation_entretien attestation_entretien_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien
    ADD CONSTRAINT attestation_entretien_pkey PRIMARY KEY (id);


--
-- TOC entry 5521 (class 2606 OID 1511041)
-- Name: attestation_entretien_point_controle attestation_entretien_point_controle_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_point_controle
    ADD CONSTRAINT attestation_entretien_point_controle_pkey PRIMARY KEY (idattestation_entretien, idpoint_controle);


--
-- TOC entry 5523 (class 2606 OID 1511043)
-- Name: facture_categorie categorie_facture_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_categorie
    ADD CONSTRAINT categorie_facture_pkey PRIMARY KEY (id);


--
-- TOC entry 5527 (class 2606 OID 1511045)
-- Name: categorie_pro categorie_pro_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.categorie_pro
    ADD CONSTRAINT categorie_pro_pkey PRIMARY KEY (id);


--
-- TOC entry 5530 (class 2606 OID 1511047)
-- Name: cgv cgv_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.cgv
    ADD CONSTRAINT cgv_pkey PRIMARY KEY (id);


--
-- TOC entry 5532 (class 2606 OID 1511049)
-- Name: classe_energetique classe_energetique_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classe_energetique
    ADD CONSTRAINT classe_energetique_pkey PRIMARY KEY (id);


--
-- TOC entry 5534 (class 2606 OID 1511051)
-- Name: classe_rendement classe_rendement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classe_rendement
    ADD CONSTRAINT classe_rendement_pkey PRIMARY KEY (id);


--
-- TOC entry 5536 (class 2606 OID 1511053)
-- Name: classification_energetique classification_energetique_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classification_energetique
    ADD CONSTRAINT classification_energetique_pkey PRIMARY KEY (id);


--
-- TOC entry 5551 (class 2606 OID 1511055)
-- Name: client_adresse client_adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_adresse
    ADD CONSTRAINT client_adresse_pkey PRIMARY KEY (idclient, idadresse);


--
-- TOC entry 5553 (class 2606 OID 1511057)
-- Name: client_email client_email_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_email
    ADD CONSTRAINT client_email_pkey PRIMARY KEY (id);


--
-- TOC entry 5541 (class 2606 OID 1511059)
-- Name: client client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_pkey PRIMARY KEY (id);


--
-- TOC entry 5557 (class 2606 OID 1511061)
-- Name: client_site client_site_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_site
    ADD CONSTRAINT client_site_pkey PRIMARY KEY (idclient, idsite);


--
-- TOC entry 5561 (class 2606 OID 1511063)
-- Name: client_tel client_tel_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_tel
    ADD CONSTRAINT client_tel_pkey PRIMARY KEY (id);


--
-- TOC entry 5565 (class 2606 OID 1511065)
-- Name: code_postal_antennes code_postal_antennes_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.code_postal_antennes
    ADD CONSTRAINT code_postal_antennes_pkey PRIMARY KEY (idsite, code_postal);


--
-- TOC entry 5567 (class 2606 OID 1511067)
-- Name: communication_canal communication_canal_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_canal
    ADD CONSTRAINT communication_canal_pkey PRIMARY KEY (id);


--
-- TOC entry 5569 (class 2606 OID 1511069)
-- Name: communication_client communication_client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_pkey PRIMARY KEY (id);


--
-- TOC entry 5576 (class 2606 OID 1511071)
-- Name: communication_type communication_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_type
    ADD CONSTRAINT communication_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5578 (class 2606 OID 1511073)
-- Name: compte_client_web compte_client_web_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.compte_client_web
    ADD CONSTRAINT compte_client_web_pkey PRIMARY KEY (id);


--
-- TOC entry 5580 (class 2606 OID 1511075)
-- Name: conseil conseil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.conseil
    ADD CONSTRAINT conseil_pkey PRIMARY KEY (id);


--
-- TOC entry 5592 (class 2606 OID 1511077)
-- Name: contrat_motif_resiliation contrat_motif_resiliation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_motif_resiliation
    ADD CONSTRAINT contrat_motif_resiliation_pkey PRIMARY KEY (id);


--
-- TOC entry 5582 (class 2606 OID 1511079)
-- Name: contrat contrat_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat
    ADD CONSTRAINT contrat_pkey PRIMARY KEY (id);


--
-- TOC entry 5594 (class 2606 OID 1511081)
-- Name: contrat_plage contrat_plage_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_plage
    ADD CONSTRAINT contrat_plage_pkey PRIMARY KEY (id);


--
-- TOC entry 5596 (class 2606 OID 1511083)
-- Name: contrat_proposition contrat_proposition_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_proposition
    ADD CONSTRAINT contrat_proposition_pkey PRIMARY KEY (id);


--
-- TOC entry 5600 (class 2606 OID 1511085)
-- Name: contrat_regroupement contrat_regroupement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_regroupement
    ADD CONSTRAINT contrat_regroupement_pkey PRIMARY KEY (id);


--
-- TOC entry 5602 (class 2606 OID 1511087)
-- Name: contrat_relance contrat_relance_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_relance
    ADD CONSTRAINT contrat_relance_pkey PRIMARY KEY (id);


--
-- TOC entry 5605 (class 2606 OID 1511089)
-- Name: contrat_resiliation contrat_resiliation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_pkey PRIMARY KEY (id);


--
-- TOC entry 5607 (class 2606 OID 1511091)
-- Name: contrat_tarif contrat_tarif_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_tarif
    ADD CONSTRAINT contrat_tarif_pkey PRIMARY KEY (id);


--
-- TOC entry 5611 (class 2606 OID 1511093)
-- Name: contrat_type contrat_type_libelle_court_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_type
    ADD CONSTRAINT contrat_type_libelle_court_key UNIQUE (libelle_court);


--
-- TOC entry 5613 (class 2606 OID 1511095)
-- Name: contrat_type contrat_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_type
    ADD CONSTRAINT contrat_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5615 (class 2606 OID 1511097)
-- Name: courrier_client courrier_client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.courrier_client
    ADD CONSTRAINT courrier_client_pkey PRIMARY KEY (id);


--
-- TOC entry 5620 (class 2606 OID 1511099)
-- Name: demande_documentation demande_documentation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.demande_documentation
    ADD CONSTRAINT demande_documentation_pkey PRIMARY KEY (id);


--
-- TOC entry 5628 (class 2606 OID 1511101)
-- Name: devis_ligne devis_ligne_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne
    ADD CONSTRAINT devis_ligne_pkey PRIMARY KEY (id);


--
-- TOC entry 5625 (class 2606 OID 1511103)
-- Name: devis devis_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_pkey PRIMARY KEY (id);


--
-- TOC entry 5630 (class 2606 OID 1511105)
-- Name: devis_statut devis_statut_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_statut
    ADD CONSTRAINT devis_statut_pkey PRIMARY KEY (id);


--
-- TOC entry 5632 (class 2606 OID 1511107)
-- Name: droit_portail droit_portail_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.droit_portail
    ADD CONSTRAINT droit_portail_pkey PRIMARY KEY (id);


--
-- TOC entry 5657 (class 2606 OID 1511109)
-- Name: equipement_alimentation equipement_alimentation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_alimentation
    ADD CONSTRAINT equipement_alimentation_pkey PRIMARY KEY (id);


--
-- TOC entry 5659 (class 2606 OID 1511111)
-- Name: equipement_complement equipement_complement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_complement
    ADD CONSTRAINT equipement_complement_pkey PRIMARY KEY (idequipement, idtype_complement);


--
-- TOC entry 5667 (class 2606 OID 1511113)
-- Name: equipement_famille equipement_famille_code_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_famille
    ADD CONSTRAINT equipement_famille_code_key UNIQUE (code);


--
-- TOC entry 5663 (class 2606 OID 1511115)
-- Name: equipement_famille_contrat equipement_famille_contrat_code_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_famille_contrat
    ADD CONSTRAINT equipement_famille_contrat_code_key UNIQUE (code);


--
-- TOC entry 5665 (class 2606 OID 1511117)
-- Name: equipement_famille_contrat equipement_famille_contrat_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_famille_contrat
    ADD CONSTRAINT equipement_famille_contrat_pkey PRIMARY KEY (id);


--
-- TOC entry 5669 (class 2606 OID 1511119)
-- Name: equipement_famille equipement_famille_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_famille
    ADD CONSTRAINT equipement_famille_pkey PRIMARY KEY (id);


--
-- TOC entry 5671 (class 2606 OID 1511121)
-- Name: equipement_fluide equipement_fluide_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_fluide
    ADD CONSTRAINT equipement_fluide_pkey PRIMARY KEY (id);


--
-- TOC entry 5673 (class 2606 OID 1511123)
-- Name: equipement_groupe equipement_groupe_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_groupe
    ADD CONSTRAINT equipement_groupe_pkey PRIMARY KEY (id);


--
-- TOC entry 5678 (class 2606 OID 1511125)
-- Name: equipement_groupe_type equipement_groupe_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_groupe_type
    ADD CONSTRAINT equipement_groupe_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5680 (class 2606 OID 1511127)
-- Name: equipement_hauteur equipement_hauteur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_hauteur
    ADD CONSTRAINT equipement_hauteur_pkey PRIMARY KEY (id);


--
-- TOC entry 5683 (class 2606 OID 1511129)
-- Name: equipement_installation equipement_installation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_installation
    ADD CONSTRAINT equipement_installation_pkey PRIMARY KEY (id);


--
-- TOC entry 5685 (class 2606 OID 1511131)
-- Name: equipement_local equipement_local_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_local
    ADD CONSTRAINT equipement_local_pkey PRIMARY KEY (id);


--
-- TOC entry 5687 (class 2606 OID 1511133)
-- Name: equipement_marque equipement_marque_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_marque
    ADD CONSTRAINT equipement_marque_pkey PRIMARY KEY (id);


--
-- TOC entry 5689 (class 2606 OID 1511135)
-- Name: equipement_mesure equipement_mesure_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_mesure
    ADD CONSTRAINT equipement_mesure_pkey PRIMARY KEY (idequipement, idintervention);


--
-- TOC entry 5691 (class 2606 OID 1511137)
-- Name: equipement_option equipement_option_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_option
    ADD CONSTRAINT equipement_option_pkey PRIMARY KEY (id);


--
-- TOC entry 5637 (class 2606 OID 1511139)
-- Name: equipement equipement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_pkey PRIMARY KEY (id);


--
-- TOC entry 5696 (class 2606 OID 1511141)
-- Name: equipement_preferences_planification equipement_preferences_planification_idequipement; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_preferences_planification
    ADD CONSTRAINT equipement_preferences_planification_idequipement UNIQUE (idequipement);


--
-- TOC entry 5698 (class 2606 OID 1511143)
-- Name: equipement_preferences_planification equipement_preferences_planification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_preferences_planification
    ADD CONSTRAINT equipement_preferences_planification_pkey PRIMARY KEY (id);


--
-- TOC entry 5703 (class 2606 OID 1511145)
-- Name: equipement_releve equipement_releve_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_releve
    ADD CONSTRAINT equipement_releve_pkey PRIMARY KEY (id);


--
-- TOC entry 5705 (class 2606 OID 1511147)
-- Name: equipement_tranche equipement_tranche_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_tranche
    ADD CONSTRAINT equipement_tranche_pkey PRIMARY KEY (id);


--
-- TOC entry 5711 (class 2606 OID 1511149)
-- Name: equipement_type_famille equipement_type_famille_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_famille
    ADD CONSTRAINT equipement_type_famille_pkey PRIMARY KEY (id);


--
-- TOC entry 5715 (class 2606 OID 1511151)
-- Name: equipement_type_option equipement_type_option_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_option
    ADD CONSTRAINT equipement_type_option_pkey PRIMARY KEY (idequipement_type, idoption);


--
-- TOC entry 5707 (class 2606 OID 1511153)
-- Name: equipement_type equipement_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type
    ADD CONSTRAINT equipement_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5719 (class 2606 OID 1511155)
-- Name: equipement_type_puissance equipement_type_puissance_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_puissance
    ADD CONSTRAINT equipement_type_puissance_pkey PRIMARY KEY (id);


--
-- TOC entry 5709 (class 2606 OID 1511157)
-- Name: equipement_type equipement_type_type_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type
    ADD CONSTRAINT equipement_type_type_key UNIQUE (type);


--
-- TOC entry 5723 (class 2606 OID 1511159)
-- Name: equipement_zone equipement_zone_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_zone
    ADD CONSTRAINT equipement_zone_pkey PRIMARY KEY (idequipement, idtype_zone, numero);


--
-- TOC entry 5727 (class 2606 OID 1511161)
-- Name: etat_civil etat_civil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.etat_civil
    ADD CONSTRAINT etat_civil_pkey PRIMARY KEY (id);


--
-- TOC entry 5748 (class 2606 OID 1511163)
-- Name: facture_ligne facture_ligne_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne
    ADD CONSTRAINT facture_ligne_pkey PRIMARY KEY (id);


--
-- TOC entry 5738 (class 2606 OID 1511165)
-- Name: facture facture_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_pkey PRIMARY KEY (id);


--
-- TOC entry 5753 (class 2606 OID 1511167)
-- Name: facture_relance facture_relance_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_relance
    ADD CONSTRAINT facture_relance_pkey PRIMARY KEY (id);


--
-- TOC entry 5756 (class 2606 OID 1511169)
-- Name: facture_tva facture_tva_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_tva
    ADD CONSTRAINT facture_tva_pkey PRIMARY KEY (idfacture, idtaux_tva);


--
-- TOC entry 5758 (class 2606 OID 1511171)
-- Name: facture_type facture_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_type
    ADD CONSTRAINT facture_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5760 (class 2606 OID 1511173)
-- Name: famille_agi famille_agi_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.famille_agi
    ADD CONSTRAINT famille_agi_pkey PRIMARY KEY (id);


--
-- TOC entry 5762 (class 2606 OID 1511175)
-- Name: formation formation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.formation
    ADD CONSTRAINT formation_pkey PRIMARY KEY (id);


--
-- TOC entry 5769 (class 2606 OID 1511177)
-- Name: groupe_droit_portail groupe_droit_portail_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_droit_portail
    ADD CONSTRAINT groupe_droit_portail_pkey PRIMARY KEY (id);


--
-- TOC entry 5764 (class 2606 OID 1511179)
-- Name: groupe groupe_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe
    ADD CONSTRAINT groupe_pkey PRIMARY KEY (id);


--
-- TOC entry 5771 (class 2606 OID 1511181)
-- Name: groupe_type groupe_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_type
    ADD CONSTRAINT groupe_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5773 (class 2606 OID 1511183)
-- Name: groupe_utilisateur groupe_utilisateur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_utilisateur
    ADD CONSTRAINT groupe_utilisateur_pkey PRIMARY KEY (idutilisateur, idgroupe);


--
-- TOC entry 5777 (class 2606 OID 1511185)
-- Name: historique_client_equipement historique_client_equipement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement
    ADD CONSTRAINT historique_client_equipement_pkey PRIMARY KEY (id);


--
-- TOC entry 5783 (class 2606 OID 1511187)
-- Name: historique_equipement_local historique_equipement_local_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_local
    ADD CONSTRAINT historique_equipement_local_pkey PRIMARY KEY (id);


--
-- TOC entry 5786 (class 2606 OID 1511189)
-- Name: historique_equipement_utilisateur historique_equipement_utilisateur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_utilisateur
    ADD CONSTRAINT historique_equipement_utilisateur_pkey PRIMARY KEY (id);


--
-- TOC entry 5788 (class 2606 OID 1511191)
-- Name: historique_modification historique_modification_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_pkey PRIMARY KEY (id);


--
-- TOC entry 5799 (class 2606 OID 1511193)
-- Name: installateur installateur_code_agi_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.installateur
    ADD CONSTRAINT installateur_code_agi_key UNIQUE (code_agi);


--
-- TOC entry 5801 (class 2606 OID 1511195)
-- Name: installateur installateur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.installateur
    ADD CONSTRAINT installateur_pkey PRIMARY KEY (id);


--
-- TOC entry 5821 (class 2606 OID 1511197)
-- Name: intervention_annulation intervention_annulation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_annulation
    ADD CONSTRAINT intervention_annulation_pkey PRIMARY KEY (id);


--
-- TOC entry 5823 (class 2606 OID 1511199)
-- Name: intervention_anomalie intervention_anomalie_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_anomalie
    ADD CONSTRAINT intervention_anomalie_pkey PRIMARY KEY (id);


--
-- TOC entry 5826 (class 2606 OID 1511201)
-- Name: intervention_document intervention_document_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_document
    ADD CONSTRAINT intervention_document_pkey PRIMARY KEY (id);


--
-- TOC entry 5814 (class 2606 OID 1511203)
-- Name: intervention intervention_idplanning_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idplanning_key UNIQUE (idplanning);


--
-- TOC entry 5829 (class 2606 OID 1511205)
-- Name: intervention_media intervention_media_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_media
    ADD CONSTRAINT intervention_media_pkey PRIMARY KEY (id);


--
-- TOC entry 5831 (class 2606 OID 1511207)
-- Name: intervention_message_co intervention_message_co_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_message_co
    ADD CONSTRAINT intervention_message_co_pkey PRIMARY KEY (id);


--
-- TOC entry 5833 (class 2606 OID 1511209)
-- Name: intervention_mesure intervention_mesure_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_mesure
    ADD CONSTRAINT intervention_mesure_pkey PRIMARY KEY (idintervention, idtype_mesure);


--
-- TOC entry 5837 (class 2606 OID 1511211)
-- Name: intervention_motif_abandon intervention_motif_abandon_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_abandon
    ADD CONSTRAINT intervention_motif_abandon_pkey PRIMARY KEY (id);


--
-- TOC entry 5839 (class 2606 OID 1511213)
-- Name: intervention_motif_absence intervention_motif_absence_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_absence
    ADD CONSTRAINT intervention_motif_absence_pkey PRIMARY KEY (id);


--
-- TOC entry 5841 (class 2606 OID 1511215)
-- Name: intervention_motif_annulation intervention_motif_annulation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif_annulation
    ADD CONSTRAINT intervention_motif_annulation_pkey PRIMARY KEY (id);


--
-- TOC entry 5835 (class 2606 OID 1511217)
-- Name: intervention_motif intervention_motif_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_motif
    ADD CONSTRAINT intervention_motif_pkey PRIMARY KEY (id);


--
-- TOC entry 5816 (class 2606 OID 1511219)
-- Name: intervention intervention_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_pkey PRIMARY KEY (id);


--
-- TOC entry 5846 (class 2606 OID 1511221)
-- Name: intervention_pre_encaissement intervention_pre_encaissement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement
    ADD CONSTRAINT intervention_pre_encaissement_pkey PRIMARY KEY (id);


--
-- TOC entry 5849 (class 2606 OID 1511223)
-- Name: intervention_stack intervention_stack_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_stack
    ADD CONSTRAINT intervention_stack_pkey PRIMARY KEY (id);


--
-- TOC entry 5851 (class 2606 OID 1511225)
-- Name: intervention_type_validation intervention_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_type_validation
    ADD CONSTRAINT intervention_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5856 (class 2606 OID 1511227)
-- Name: lock_entites lock_entites_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.lock_entites
    ADD CONSTRAINT lock_entites_pkey PRIMARY KEY (id);


--
-- TOC entry 5873 (class 2606 OID 1511229)
-- Name: mag_commande_histo mag_commande_histo_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande_histo
    ADD CONSTRAINT mag_commande_histo_pkey PRIMARY KEY (id);


--
-- TOC entry 5867 (class 2606 OID 1511231)
-- Name: mag_commande mag_commande_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_pkey PRIMARY KEY (id);


--
-- TOC entry 5875 (class 2606 OID 1511233)
-- Name: mag_etat_commande mag_etat_commande_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_etat_commande
    ADD CONSTRAINT mag_etat_commande_pkey PRIMARY KEY (id);


--
-- TOC entry 5877 (class 2606 OID 1511235)
-- Name: mag_fermeture_meaux mag_fermeture_meaux_date_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_fermeture_meaux
    ADD CONSTRAINT mag_fermeture_meaux_date_key UNIQUE (date);


--
-- TOC entry 5879 (class 2606 OID 1511237)
-- Name: mag_fermeture_meaux mag_fermeture_meaux_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_fermeture_meaux
    ADD CONSTRAINT mag_fermeture_meaux_pkey PRIMARY KEY (id);


--
-- TOC entry 5882 (class 2606 OID 1511239)
-- Name: mag_jour_exclusion_livraison mag_jour_exclusion_livraison_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_jour_exclusion_livraison
    ADD CONSTRAINT mag_jour_exclusion_livraison_pkey PRIMARY KEY (id);


--
-- TOC entry 5886 (class 2606 OID 1511241)
-- Name: mag_ligne_commande mag_ligne_commande_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_ligne_commande
    ADD CONSTRAINT mag_ligne_commande_pkey PRIMARY KEY (id);


--
-- TOC entry 5888 (class 2606 OID 1511243)
-- Name: mag_statut_commande mag_statut_commande_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_statut_commande
    ADD CONSTRAINT mag_statut_commande_pkey PRIMARY KEY (id);


--
-- TOC entry 5893 (class 2606 OID 1511245)
-- Name: mag_stock_mouvement mag_stock_mouvement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_stock_mouvement
    ADD CONSTRAINT mag_stock_mouvement_pkey PRIMARY KEY (id);


--
-- TOC entry 5895 (class 2606 OID 1511247)
-- Name: mag_type_commande mag_type_commande_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_type_commande
    ADD CONSTRAINT mag_type_commande_pkey PRIMARY KEY (id);


--
-- TOC entry 5899 (class 2606 OID 1511249)
-- Name: motif_debit_gaz motif_debit_gaz_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_debit_gaz
    ADD CONSTRAINT motif_debit_gaz_pkey PRIMARY KEY (id);


--
-- TOC entry 5901 (class 2606 OID 1511251)
-- Name: motif_modif_client motif_modif_client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_modif_client
    ADD CONSTRAINT motif_modif_client_pkey PRIMARY KEY (id);


--
-- TOC entry 5903 (class 2606 OID 1511253)
-- Name: motif_temps_partiel motif_temps_partiel_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.motif_temps_partiel
    ADD CONSTRAINT motif_temps_partiel_pkey PRIMARY KEY (id);


--
-- TOC entry 5905 (class 2606 OID 1511255)
-- Name: moyen_paiement moyen_paiement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.moyen_paiement
    ADD CONSTRAINT moyen_paiement_pkey PRIMARY KEY (id);


--
-- TOC entry 5635 (class 2606 OID 1511257)
-- Name: energie nature_gaz_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.energie
    ADD CONSTRAINT nature_gaz_pkey PRIMARY KEY (id);


--
-- TOC entry 5907 (class 2606 OID 1511259)
-- Name: observation observation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.observation
    ADD CONSTRAINT observation_pkey PRIMARY KEY (id);


--
-- TOC entry 5909 (class 2606 OID 1511261)
-- Name: old_bloc_note_client old_bloc_note_client_idequipement_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.old_bloc_note_client
    ADD CONSTRAINT old_bloc_note_client_idequipement_key UNIQUE (idequipement);


--
-- TOC entry 5911 (class 2606 OID 1511263)
-- Name: old_bloc_note_client old_bloc_note_client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.old_bloc_note_client
    ADD CONSTRAINT old_bloc_note_client_pkey PRIMARY KEY (id);


--
-- TOC entry 5913 (class 2606 OID 1511265)
-- Name: option option_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option
    ADD CONSTRAINT option_pkey PRIMARY KEY (id);


--
-- TOC entry 5917 (class 2606 OID 1511267)
-- Name: option_tarif option_tarif_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif
    ADD CONSTRAINT option_tarif_pkey PRIMARY KEY (id);


--
-- TOC entry 5921 (class 2606 OID 1511269)
-- Name: paiement paiement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.paiement
    ADD CONSTRAINT paiement_pkey PRIMARY KEY (id);


--
-- TOC entry 5923 (class 2606 OID 1511271)
-- Name: parametre parametre_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.parametre
    ADD CONSTRAINT parametre_pkey PRIMARY KEY (id);


--
-- TOC entry 5736 (class 2606 OID 1511273)
-- Name: evenement_objet pk_actions; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_objet
    ADD CONSTRAINT pk_actions PRIMARY KEY (id);


--
-- TOC entry 5525 (class 2606 OID 1511275)
-- Name: categorie_planification pk_categorie_planification; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.categorie_planification
    ADD CONSTRAINT pk_categorie_planification PRIMARY KEY (id);


--
-- TOC entry 5795 (class 2606 OID 1511277)
-- Name: horaire_passage pk_horaire_passage; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.horaire_passage
    ADD CONSTRAINT pk_horaire_passage PRIMARY KEY (id);


--
-- TOC entry 5853 (class 2606 OID 1511279)
-- Name: jour_exceptionnel pk_jour; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.jour_exceptionnel
    ADD CONSTRAINT pk_jour PRIMARY KEY (date, travaille);


--
-- TOC entry 5732 (class 2606 OID 1511281)
-- Name: evenement_lieu pk_lieux; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_lieu
    ADD CONSTRAINT pk_lieux PRIMARY KEY (id);


--
-- TOC entry 5897 (class 2606 OID 1511283)
-- Name: moment_passage pk_moment_passage; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.moment_passage
    ADD CONSTRAINT pk_moment_passage PRIMARY KEY (id);


--
-- TOC entry 5935 (class 2606 OID 1511285)
-- Name: planning_agent_exclusion_type_planification pk_planning_agent_exclusion_type_planification; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_agent_exclusion_type_planification
    ADD CONSTRAINT pk_planning_agent_exclusion_type_planification PRIMARY KEY (idutilisateur_agent, idtype_planification);


--
-- TOC entry 5937 (class 2606 OID 1511287)
-- Name: planning_banque_media pk_planning_banque_media; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_banque_media
    ADD CONSTRAINT pk_planning_banque_media PRIMARY KEY (id);


--
-- TOC entry 5940 (class 2606 OID 1511289)
-- Name: planning_blocage pk_planning_blocage; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_blocage
    ADD CONSTRAINT pk_planning_blocage PRIMARY KEY (idutilisateur_agent_bloque, date_bloquee);


--
-- TOC entry 5951 (class 2606 OID 1511291)
-- Name: planning_historique_modification pk_planning_historique_modification; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT pk_planning_historique_modification PRIMARY KEY (id);


--
-- TOC entry 5953 (class 2606 OID 1511293)
-- Name: planning_initiative_detail pk_planning_initiative; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_initiative_detail
    ADD CONSTRAINT pk_planning_initiative PRIMARY KEY (id);


--
-- TOC entry 5955 (class 2606 OID 1511295)
-- Name: planning_initiative_type pk_planning_initiative_type; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_initiative_type
    ADD CONSTRAINT pk_planning_initiative_type PRIMARY KEY (id);


--
-- TOC entry 5734 (class 2606 OID 1511297)
-- Name: evenement_lieu_type_planification pk_planning_lieu_type_evenement; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_lieu_type_planification
    ADD CONSTRAINT pk_planning_lieu_type_evenement PRIMARY KEY (idevenement_lieu, idtype_planification);


--
-- TOC entry 5730 (class 2606 OID 1511299)
-- Name: evenement pk_planning_reunion; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT pk_planning_reunion PRIMARY KEY (idplanning);


--
-- TOC entry 5957 (class 2606 OID 1511301)
-- Name: planning_transit pk_planning_transit; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_transit
    ADD CONSTRAINT pk_planning_transit PRIMARY KEY (idplanning);


--
-- TOC entry 6094 (class 2606 OID 1511303)
-- Name: type_duree pk_type_duree; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_duree
    ADD CONSTRAINT pk_type_duree PRIMARY KEY (id);


--
-- TOC entry 6112 (class 2606 OID 1511305)
-- Name: type_planification pk_type_planification; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification
    ADD CONSTRAINT pk_type_planification PRIMARY KEY (id);


--
-- TOC entry 5933 (class 2606 OID 1511307)
-- Name: planning_action planning_action_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_action
    ADD CONSTRAINT planning_action_pkey PRIMARY KEY (id);


--
-- TOC entry 5942 (class 2606 OID 1511309)
-- Name: planning_conflit planning_conflit_idplanning_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_conflit
    ADD CONSTRAINT planning_conflit_idplanning_key UNIQUE (idplanning);


--
-- TOC entry 5944 (class 2606 OID 1511311)
-- Name: planning_conflit planning_conflit_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_conflit
    ADD CONSTRAINT planning_conflit_pkey PRIMARY KEY (id);


--
-- TOC entry 5931 (class 2606 OID 1511313)
-- Name: planning planning_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT planning_pkey PRIMARY KEY (id);


--
-- TOC entry 5959 (class 2606 OID 1511315)
-- Name: point_controle point_controle_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.point_controle
    ADD CONSTRAINT point_controle_pkey PRIMARY KEY (id);


--
-- TOC entry 5963 (class 2606 OID 1511317)
-- Name: porte_ouverte porte_ouverte_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.porte_ouverte
    ADD CONSTRAINT porte_ouverte_pkey PRIMARY KEY (id);


--
-- TOC entry 5967 (class 2606 OID 1511319)
-- Name: privilege privilege_idintervention_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_idintervention_key UNIQUE (idintervention);


--
-- TOC entry 5969 (class 2606 OID 1511321)
-- Name: privilege privilege_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_pkey PRIMARY KEY (id);


--
-- TOC entry 5971 (class 2606 OID 1511323)
-- Name: privilege_raison_refus privilege_raison_refus_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege_raison_refus
    ADD CONSTRAINT privilege_raison_refus_pkey PRIMARY KEY (id);


--
-- TOC entry 5973 (class 2606 OID 1511325)
-- Name: privilege_statut privilege_statut_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege_statut
    ADD CONSTRAINT privilege_statut_pkey PRIMARY KEY (id);


--
-- TOC entry 5980 (class 2606 OID 1511327)
-- Name: produit_facture_affectation produit_facture_affectation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_facture_affectation
    ADD CONSTRAINT produit_facture_affectation_pkey PRIMARY KEY (id);


--
-- TOC entry 5983 (class 2606 OID 1511329)
-- Name: produit_famille produit_famille_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_famille
    ADD CONSTRAINT produit_famille_pkey PRIMARY KEY (id);


--
-- TOC entry 5986 (class 2606 OID 1511331)
-- Name: produit_photo produit_photo_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_photo
    ADD CONSTRAINT produit_photo_pkey PRIMARY KEY (id);


--
-- TOC entry 5978 (class 2606 OID 1511333)
-- Name: produit produit_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit
    ADD CONSTRAINT produit_pkey PRIMARY KEY (id);


--
-- TOC entry 5990 (class 2606 OID 1511335)
-- Name: produit_prestation_tarif produit_prestation_tarif_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_prestation_tarif
    ADD CONSTRAINT produit_prestation_tarif_pkey PRIMARY KEY (id);


--
-- TOC entry 5994 (class 2606 OID 1511337)
-- Name: produit_stock_site produit_stock_site_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_stock_site
    ADD CONSTRAINT produit_stock_site_pkey PRIMARY KEY (idsite, idproduit);


--
-- TOC entry 5996 (class 2606 OID 1511339)
-- Name: produit_type produit_type_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_type
    ADD CONSTRAINT produit_type_pkey PRIMARY KEY (id);


--
-- TOC entry 5998 (class 2606 OID 1511341)
-- Name: protection_sanitaire protection_sanitaire_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.protection_sanitaire
    ADD CONSTRAINT protection_sanitaire_pkey PRIMARY KEY (id);


--
-- TOC entry 5701 (class 2606 OID 1511343)
-- Name: equipement_puissance puissance_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_puissance
    ADD CONSTRAINT puissance_pkey PRIMARY KEY (id);


--
-- TOC entry 6000 (class 2606 OID 1511345)
-- Name: raccordement raccordement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.raccordement
    ADD CONSTRAINT raccordement_pkey PRIMARY KEY (id);


--
-- TOC entry 6003 (class 2606 OID 1511347)
-- Name: retour retour_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.retour
    ADD CONSTRAINT retour_pkey PRIMARY KEY (id);


--
-- TOC entry 6005 (class 2606 OID 1511349)
-- Name: robinet_remplissage robinet_remplissage_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.robinet_remplissage
    ADD CONSTRAINT robinet_remplissage_pkey PRIMARY KEY (id);


--
-- TOC entry 6015 (class 2606 OID 1511351)
-- Name: secteur_activite secteur_activite_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_activite
    ADD CONSTRAINT secteur_activite_pkey PRIMARY KEY (id);


--
-- TOC entry 6019 (class 2606 OID 1511353)
-- Name: secteur_equipement secteur_equipement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_equipement
    ADD CONSTRAINT secteur_equipement_pkey PRIMARY KEY (idsecteur, idequipement);


--
-- TOC entry 6013 (class 2606 OID 1511355)
-- Name: secteur secteur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_pkey PRIMARY KEY (id);


--
-- TOC entry 6021 (class 2606 OID 1511357)
-- Name: secteur_tarif secteur_tarif_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_tarif
    ADD CONSTRAINT secteur_tarif_pkey PRIMARY KEY (id);


--
-- TOC entry 6023 (class 2606 OID 1511359)
-- Name: secteur_taux_retour secteur_taux_retour_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_taux_retour
    ADD CONSTRAINT secteur_taux_retour_pkey PRIMARY KEY (id);


--
-- TOC entry 6025 (class 2606 OID 1511361)
-- Name: secteur_zone secteur_zone_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_zone
    ADD CONSTRAINT secteur_zone_pkey PRIMARY KEY (id);


--
-- TOC entry 6029 (class 2606 OID 1511363)
-- Name: sectorisation_version sectorisation_version_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.sectorisation_version
    ADD CONSTRAINT sectorisation_version_pkey PRIMARY KEY (id);


--
-- TOC entry 6032 (class 2606 OID 1511365)
-- Name: site site_num_key; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.site
    ADD CONSTRAINT site_num_key UNIQUE (num);


--
-- TOC entry 6034 (class 2606 OID 1511367)
-- Name: site site_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.site
    ADD CONSTRAINT site_pkey PRIMARY KEY (id);


--
-- TOC entry 6037 (class 2606 OID 1511369)
-- Name: stock_standard stock_standard_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard
    ADD CONSTRAINT stock_standard_pkey PRIMARY KEY (id);


--
-- TOC entry 6041 (class 2606 OID 1511371)
-- Name: stock_standard_produit stock_standard_produit_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard_produit
    ADD CONSTRAINT stock_standard_produit_pkey PRIMARY KEY (id);


--
-- TOC entry 6043 (class 2606 OID 1511373)
-- Name: tablette_statut tablette_statut_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tablette_statut
    ADD CONSTRAINT tablette_statut_pkey PRIMARY KEY (id);


--
-- TOC entry 6045 (class 2606 OID 1511375)
-- Name: taux_tva taux_tva_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.taux_tva
    ADD CONSTRAINT taux_tva_pkey PRIMARY KEY (id);


--
-- TOC entry 6049 (class 2606 OID 1511377)
-- Name: tchat_message tchat_message_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tchat_message
    ADD CONSTRAINT tchat_message_pkey PRIMARY KEY (id);


--
-- TOC entry 6051 (class 2606 OID 1511379)
-- Name: tmp_correspondance_agent tmp_correspondance_agent_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_agent
    ADD CONSTRAINT tmp_correspondance_agent_pkey PRIMARY KEY (idsite, idutilisateur);


--
-- TOC entry 6053 (class 2606 OID 1511381)
-- Name: tmp_correspondance_equipement tmp_correspondance_equipement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_equipement
    ADD CONSTRAINT tmp_correspondance_equipement_pkey PRIMARY KEY (idsite, idequipement);


--
-- TOC entry 6057 (class 2606 OID 1511383)
-- Name: tmp_correspondance_formation_organisme tmp_correspondance_formation_organisme_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_formation_organisme
    ADD CONSTRAINT tmp_correspondance_formation_organisme_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6055 (class 2606 OID 1511385)
-- Name: tmp_correspondance_formation tmp_correspondance_formation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_formation
    ADD CONSTRAINT tmp_correspondance_formation_pkey PRIMARY KEY (code_oracle, idsite);


--
-- TOC entry 6059 (class 2606 OID 1511387)
-- Name: tmp_correspondance_horaire_passage tmp_correspondance_horaire_passage_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_horaire_passage
    ADD CONSTRAINT tmp_correspondance_horaire_passage_pkey PRIMARY KEY (idsite, horaire_passage_oracle);


--
-- TOC entry 6061 (class 2606 OID 1511389)
-- Name: tmp_correspondance_intervention_planning tmp_correspondance_intervention_planning_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_intervention_planning
    ADD CONSTRAINT tmp_correspondance_intervention_planning_pkey PRIMARY KEY (idintervention, idpln_planning);


--
-- TOC entry 6063 (class 2606 OID 1511391)
-- Name: tmp_correspondance_moment_passage tmp_correspondance_moment_passage_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_moment_passage
    ADD CONSTRAINT tmp_correspondance_moment_passage_pkey PRIMARY KEY (idsite, moment_passage_oracle);


--
-- TOC entry 6065 (class 2606 OID 1511393)
-- Name: tmp_correspondance_motif_maladie tmp_correspondance_motif_maladie_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_motif_maladie
    ADD CONSTRAINT tmp_correspondance_motif_maladie_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6067 (class 2606 OID 1511395)
-- Name: tmp_correspondance_motif_reserve tmp_correspondance_motif_reserve_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_motif_reserve
    ADD CONSTRAINT tmp_correspondance_motif_reserve_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6069 (class 2606 OID 1511397)
-- Name: tmp_correspondance_planning tmp_correspondance_planning_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_planning
    ADD CONSTRAINT tmp_correspondance_planning_pkey PRIMARY KEY (idsite, idplanning);


--
-- TOC entry 6071 (class 2606 OID 1511399)
-- Name: tmp_correspondance_reunion_lieu tmp_correspondance_reunion_lieu_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_reunion_lieu
    ADD CONSTRAINT tmp_correspondance_reunion_lieu_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6073 (class 2606 OID 1511401)
-- Name: tmp_correspondance_reunion_ordre_jour tmp_correspondance_reunion_ordre_jour_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_reunion_ordre_jour
    ADD CONSTRAINT tmp_correspondance_reunion_ordre_jour_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6075 (class 2606 OID 1511403)
-- Name: tmp_correspondance_voiture_lieu tmp_correspondance_voiture_action_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_voiture_lieu
    ADD CONSTRAINT tmp_correspondance_voiture_action_pkey PRIMARY KEY (idoracle, idsite);


--
-- TOC entry 6077 (class 2606 OID 1511405)
-- Name: type_adresse type_adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_adresse
    ADD CONSTRAINT type_adresse_pkey PRIMARY KEY (id);


--
-- TOC entry 6079 (class 2606 OID 1511407)
-- Name: type_appareil type_appareil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_appareil
    ADD CONSTRAINT type_appareil_pkey PRIMARY KEY (id);


--
-- TOC entry 6082 (class 2606 OID 1511409)
-- Name: type_client type_client_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_client
    ADD CONSTRAINT type_client_pkey PRIMARY KEY (id);


--
-- TOC entry 6086 (class 2606 OID 1511411)
-- Name: type_complement_adresse type_complement_adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_complement_adresse
    ADD CONSTRAINT type_complement_adresse_pkey PRIMARY KEY (id);


--
-- TOC entry 6084 (class 2606 OID 1511413)
-- Name: type_complement type_complement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_complement
    ADD CONSTRAINT type_complement_pkey PRIMARY KEY (id);


--
-- TOC entry 6088 (class 2606 OID 1511415)
-- Name: type_conseil type_conseil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_conseil
    ADD CONSTRAINT type_conseil_pkey PRIMARY KEY (id);


--
-- TOC entry 6090 (class 2606 OID 1511417)
-- Name: type_demandeur type_demandeur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_demandeur
    ADD CONSTRAINT type_demandeur_pkey PRIMARY KEY (id);


--
-- TOC entry 6092 (class 2606 OID 1511419)
-- Name: type_devise type_devise_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_devise
    ADD CONSTRAINT type_devise_pkey PRIMARY KEY (id);


--
-- TOC entry 6096 (class 2606 OID 1511421)
-- Name: type_email type_email_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_email
    ADD CONSTRAINT type_email_pkey PRIMARY KEY (id);


--
-- TOC entry 6098 (class 2606 OID 1511423)
-- Name: type_energie type_energie_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_energie
    ADD CONSTRAINT type_energie_pkey PRIMARY KEY (id);


--
-- TOC entry 6100 (class 2606 OID 1511425)
-- Name: type_envoi type_envoi_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_envoi
    ADD CONSTRAINT type_envoi_pkey PRIMARY KEY (id);


--
-- TOC entry 6102 (class 2606 OID 1511427)
-- Name: type_installation type_installation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_installation
    ADD CONSTRAINT type_installation_pkey PRIMARY KEY (id);


--
-- TOC entry 6105 (class 2606 OID 1511429)
-- Name: type_logement type_logement_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_logement
    ADD CONSTRAINT type_logement_pkey PRIMARY KEY (id);


--
-- TOC entry 6107 (class 2606 OID 1511431)
-- Name: type_login type_login_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_login
    ADD CONSTRAINT type_login_pkey PRIMARY KEY (id);


--
-- TOC entry 6109 (class 2606 OID 1511433)
-- Name: type_mesure type_mesure_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_mesure
    ADD CONSTRAINT type_mesure_pkey PRIMARY KEY (id);


--
-- TOC entry 6116 (class 2606 OID 1511435)
-- Name: type_planification_type_appareil type_planification_type_appareil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification_type_appareil
    ADD CONSTRAINT type_planification_type_appareil_pkey PRIMARY KEY (idtype_planification, idtype_appareil);


--
-- TOC entry 6118 (class 2606 OID 1511437)
-- Name: type_retour type_retour_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_retour
    ADD CONSTRAINT type_retour_pkey PRIMARY KEY (id);


--
-- TOC entry 6120 (class 2606 OID 1511439)
-- Name: type_tel type_tel_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_tel
    ADD CONSTRAINT type_tel_pkey PRIMARY KEY (id);


--
-- TOC entry 6122 (class 2606 OID 1511441)
-- Name: type_utilisateur type_utilisateur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_utilisateur
    ADD CONSTRAINT type_utilisateur_pkey PRIMARY KEY (id);


--
-- TOC entry 6124 (class 2606 OID 1511443)
-- Name: type_visite_intervention type_visite_intervention_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_visite_intervention
    ADD CONSTRAINT type_visite_intervention_pkey PRIMARY KEY (id);


--
-- TOC entry 6126 (class 2606 OID 1511445)
-- Name: type_zone type_zone_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_zone
    ADD CONSTRAINT type_zone_pkey PRIMARY KEY (id);


--
-- TOC entry 6135 (class 2606 OID 1511447)
-- Name: utilisateur_adresse utilisateur_adresse_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_adresse
    ADD CONSTRAINT utilisateur_adresse_pkey PRIMARY KEY (idutilisateur, idadresse);


--
-- TOC entry 6143 (class 2606 OID 1511449)
-- Name: utilisateur_affectation utilisateur_affectation_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_pkey PRIMARY KEY (id);


--
-- TOC entry 6147 (class 2606 OID 1511451)
-- Name: utilisateur_email utilisateur_email_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_email
    ADD CONSTRAINT utilisateur_email_pkey PRIMARY KEY (id);


--
-- TOC entry 6149 (class 2606 OID 1511453)
-- Name: utilisateur_filtre utilisateur_filtre_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_filtre
    ADD CONSTRAINT utilisateur_filtre_pkey PRIMARY KEY (id);


--
-- TOC entry 6133 (class 2606 OID 1511455)
-- Name: utilisateur utilisateur_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_pkey PRIMARY KEY (id);


--
-- TOC entry 6151 (class 2606 OID 1511457)
-- Name: utilisateur_profil utilisateur_profil_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_profil
    ADD CONSTRAINT utilisateur_profil_pkey PRIMARY KEY (id);


--
-- TOC entry 6153 (class 2606 OID 1511459)
-- Name: utilisateur_role utilisateur_role_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_role
    ADD CONSTRAINT utilisateur_role_pkey PRIMARY KEY (id);


--
-- TOC entry 6157 (class 2606 OID 1511461)
-- Name: utilisateur_site utilisateur_site_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_site
    ADD CONSTRAINT utilisateur_site_pkey PRIMARY KEY (idutilisateur, idsite);


--
-- TOC entry 6161 (class 2606 OID 1511463)
-- Name: utilisateur_tel utilisateur_tel_pkey; Type: CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_tel
    ADD CONSTRAINT utilisateur_tel_pkey PRIMARY KEY (id);


--
-- TOC entry 5467 (class 1259 OID 1511464)
-- Name: agent_secteur_idx_rang_tri_idsecteur_versi; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX agent_secteur_idx_rang_tri_idsecteur_versi ON sav.agent_secteur USING btree (rang_tri, idsecteur_version);


--
-- TOC entry 5638 (class 1259 OID 1511465)
-- Name: fki_equipement_idclient_ancien_souscripteur_fkey; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX fki_equipement_idclient_ancien_souscripteur_fkey ON sav.equipement USING btree (idclient_ancien_souscripteur);


--
-- TOC entry 5854 (class 1259 OID 1511466)
-- Name: fki_lock_entites_idutilisateur_fkey; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX fki_lock_entites_idutilisateur_fkey ON sav.lock_entites USING btree (id_utilisateur);


--
-- TOC entry 6127 (class 1259 OID 1511467)
-- Name: fki_utilisateur_role; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX fki_utilisateur_role ON sav.utilisateur USING btree (role_id);


--
-- TOC entry 5633 (class 1259 OID 1511468)
-- Name: idx_49b67f44ab90823c; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_49b67f44ab90823c ON sav.droit_portail USING btree (idgroupe_droit_portail);


--
-- TOC entry 5435 (class 1259 OID 1511469)
-- Name: idx_adresse_adresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_adresse_adresse ON sav.adresse USING btree (adresse);


--
-- TOC entry 5440 (class 1259 OID 1511470)
-- Name: idx_adresse_complement_idadresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_adresse_complement_idadresse ON sav.adresse_complement USING btree (idadresse);


--
-- TOC entry 5441 (class 1259 OID 1511471)
-- Name: idx_adresse_complement_idtype_complement_adresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_adresse_complement_idtype_complement_adresse ON sav.adresse_complement USING btree (idtype_complement_adresse);


--
-- TOC entry 5436 (class 1259 OID 1511472)
-- Name: idx_adresse_idtype_adresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_adresse_idtype_adresse ON sav.adresse USING btree (idtype_adresse);


--
-- TOC entry 5437 (class 1259 OID 1511473)
-- Name: idx_adresse_idtype_logement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_adresse_idtype_logement ON sav.adresse USING btree (idtype_logement);


--
-- TOC entry 5448 (class 1259 OID 1511474)
-- Name: idx_agent_appareil_idappareil; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_appareil_idappareil ON sav.agent_appareil USING btree (idappareil);


--
-- TOC entry 5449 (class 1259 OID 1511475)
-- Name: idx_agent_appareil_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_appareil_idutilisateur_agent ON sav.agent_appareil USING btree (idutilisateur_agent);


--
-- TOC entry 5452 (class 1259 OID 1511476)
-- Name: idx_agent_gps_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_gps_idutilisateur_agent ON sav.agent_gps USING btree (idutilisateur_agent);


--
-- TOC entry 5455 (class 1259 OID 1511477)
-- Name: idx_agent_produit_stock_idagent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_produit_stock_idagent ON sav.agent_produit_stock USING btree (idagent);


--
-- TOC entry 5456 (class 1259 OID 1511478)
-- Name: idx_agent_produit_stock_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_produit_stock_idproduit ON sav.agent_produit_stock USING btree (idproduit);


--
-- TOC entry 5457 (class 1259 OID 1511479)
-- Name: idx_agent_produit_stock_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_produit_stock_idsite ON sav.agent_produit_stock USING btree (idsite);


--
-- TOC entry 5458 (class 1259 OID 1511480)
-- Name: idx_agent_produit_stock_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_produit_stock_idutilisateur ON sav.agent_produit_stock USING btree (idutilisateur);


--
-- TOC entry 5461 (class 1259 OID 1511481)
-- Name: idx_agent_qualification_idequipement_famille; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_qualification_idequipement_famille ON sav.agent_qualification USING btree (idequipement_famille);


--
-- TOC entry 5462 (class 1259 OID 1511482)
-- Name: idx_agent_qualification_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_qualification_idutilisateur_agent ON sav.agent_qualification USING btree (idutilisateur_agent);


--
-- TOC entry 5465 (class 1259 OID 1511483)
-- Name: idx_agent_restriction_idtype_planification; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_restriction_idtype_planification ON sav.agent_restriction USING btree (idtype_planification);


--
-- TOC entry 5466 (class 1259 OID 1511484)
-- Name: idx_agent_restriction_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_restriction_idutilisateur_agent ON sav.agent_restriction USING btree (idutilisateur_agent);


--
-- TOC entry 5470 (class 1259 OID 1511485)
-- Name: idx_agent_secteur_idsecteur_version; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_secteur_idsecteur_version ON sav.agent_secteur USING btree (idsecteur_version);


--
-- TOC entry 5471 (class 1259 OID 1511486)
-- Name: idx_agent_secteur_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_secteur_idutilisateur_agent ON sav.agent_secteur USING btree (idutilisateur_agent);


--
-- TOC entry 5472 (class 1259 OID 1511487)
-- Name: idx_agent_secteur_rang_tri; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_agent_secteur_rang_tri ON sav.agent_secteur USING btree (rang_tri);


--
-- TOC entry 5486 (class 1259 OID 1511488)
-- Name: idx_aide_technique_histo_idaide_technique; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_histo_idaide_technique ON sav.aide_technique_histo USING btree (idaide_technique);


--
-- TOC entry 5487 (class 1259 OID 1511489)
-- Name: idx_aide_technique_histo_idaide_technique_etat; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_histo_idaide_technique_etat ON sav.aide_technique_histo USING btree (idaide_technique_etat);


--
-- TOC entry 5488 (class 1259 OID 1511490)
-- Name: idx_aide_technique_histo_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_histo_idutilisateur ON sav.aide_technique_histo USING btree (idutilisateur);


--
-- TOC entry 5475 (class 1259 OID 1511491)
-- Name: idx_aide_technique_idaide_technique_etat; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_idaide_technique_etat ON sav.aide_technique USING btree (idaide_technique_etat);


--
-- TOC entry 5476 (class 1259 OID 1511492)
-- Name: idx_aide_technique_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_idequipement ON sav.aide_technique USING btree (idequipement);


--
-- TOC entry 5477 (class 1259 OID 1511493)
-- Name: idx_aide_technique_idtype_demandeur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_aide_technique_idtype_demandeur ON sav.aide_technique USING btree (idtype_demandeur);


--
-- TOC entry 5505 (class 1259 OID 1511494)
-- Name: idx_attachement_parametre_idattachement_parametre_liste; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_attachement_parametre_idattachement_parametre_liste ON sav.attachement_parametre USING btree (idattachement_parametre_liste);


--
-- TOC entry 5512 (class 1259 OID 1511495)
-- Name: idx_attachement_profil_idutilisateur_profil; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_attachement_profil_idutilisateur_profil ON sav.attachement_profil USING btree (idutilisateur_profil);


--
-- TOC entry 5515 (class 1259 OID 1511496)
-- Name: idx_attachement_type_planification_idtype_planification; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_attachement_type_planification_idtype_planification ON sav.attachement_type_planification USING btree (idtype_planification);


--
-- TOC entry 5528 (class 1259 OID 1511497)
-- Name: idx_categorie_pro_libelle; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_categorie_pro_libelle ON sav.categorie_pro USING btree (libelle);


--
-- TOC entry 5537 (class 1259 OID 1511498)
-- Name: idx_classification_energetique_idclasse_energetique; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_classification_energetique_idclasse_energetique ON sav.classification_energetique USING btree (idclasse_energetique);


--
-- TOC entry 5538 (class 1259 OID 1511499)
-- Name: idx_classification_energetique_idclasse_rendement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_classification_energetique_idclasse_rendement ON sav.classification_energetique USING btree (idclasse_rendement);


--
-- TOC entry 5539 (class 1259 OID 1511500)
-- Name: idx_classification_energetique_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_classification_energetique_idequipement_type ON sav.classification_energetique USING btree (idequipement_type);


--
-- TOC entry 5542 (class 1259 OID 1511501)
-- Name: idx_client_code_ec; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_code_ec ON sav.client USING btree (idetat_civil);


--
-- TOC entry 5554 (class 1259 OID 1511502)
-- Name: idx_client_email_email; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_email_email ON sav.client_email USING btree (email);


--
-- TOC entry 5555 (class 1259 OID 1511503)
-- Name: idx_client_email_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_email_idclient ON sav.client_email USING btree (idclient);


--
-- TOC entry 5543 (class 1259 OID 1511504)
-- Name: idx_client_idcategorie_pro; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_idcategorie_pro ON sav.client USING btree (idcategorie_pro);


--
-- TOC entry 5544 (class 1259 OID 1511505)
-- Name: idx_client_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_idclient ON sav.client USING btree (id);


--
-- TOC entry 5545 (class 1259 OID 1511506)
-- Name: idx_client_idclient_tutelle; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_idclient_tutelle ON sav.client USING btree (idclient_tutelle);


--
-- TOC entry 5546 (class 1259 OID 1511507)
-- Name: idx_client_idcompte_client_web; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_idcompte_client_web ON sav.client USING btree (idcompte_client_web);


--
-- TOC entry 5547 (class 1259 OID 1511508)
-- Name: idx_client_idtype_client; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_idtype_client ON sav.client USING btree (idtype_client);


--
-- TOC entry 5548 (class 1259 OID 1511509)
-- Name: idx_client_nom; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_nom ON sav.client USING btree (nom);


--
-- TOC entry 5549 (class 1259 OID 1511510)
-- Name: idx_client_numero_client; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_numero_client ON sav.client USING btree (numero_client) WITH (deduplicate_items='false');


--
-- TOC entry 5562 (class 1259 OID 1511511)
-- Name: idx_client_tel_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_tel_idclient ON sav.client_tel USING btree (idclient);


--
-- TOC entry 5563 (class 1259 OID 1511512)
-- Name: idx_client_tel_idtype_tel; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_client_tel_idtype_tel ON sav.client_tel USING btree (idtype_tel);


--
-- TOC entry 5570 (class 1259 OID 1511513)
-- Name: idx_communication_client_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_communication_client_idclient ON sav.communication_client USING btree (idclient);


--
-- TOC entry 5571 (class 1259 OID 1511514)
-- Name: idx_communication_client_idcommunication_canal; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_communication_client_idcommunication_canal ON sav.communication_client USING btree (idcommunication_canal);


--
-- TOC entry 5572 (class 1259 OID 1511515)
-- Name: idx_communication_client_idcommunication_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_communication_client_idcommunication_type ON sav.communication_client USING btree (idcommunication_type);


--
-- TOC entry 5573 (class 1259 OID 1511516)
-- Name: idx_communication_client_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_communication_client_idequipement ON sav.communication_client USING btree (idequipement);


--
-- TOC entry 5574 (class 1259 OID 1511517)
-- Name: idx_communication_client_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_communication_client_idintervention ON sav.communication_client USING btree (idintervention);


--
-- TOC entry 5583 (class 1259 OID 1511518)
-- Name: idx_contrat_date_fin; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_date_fin ON sav.contrat USING btree (date_fin_contrat);


--
-- TOC entry 5584 (class 1259 OID 1511519)
-- Name: idx_contrat_dates_dernier; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_dates_dernier ON sav.contrat USING btree (date_debut_contrat, date_fin_contrat, dernier_contrat, idequipement);


--
-- TOC entry 5585 (class 1259 OID 1511520)
-- Name: idx_contrat_groupe; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_groupe ON sav.contrat USING btree (groupe);


--
-- TOC entry 5586 (class 1259 OID 1511521)
-- Name: idx_contrat_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_idclient ON sav.contrat USING btree (idclient);


--
-- TOC entry 5587 (class 1259 OID 1511522)
-- Name: idx_contrat_idcontrat_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_idcontrat_type ON sav.contrat USING btree (idcontrat_type);


--
-- TOC entry 5588 (class 1259 OID 1511523)
-- Name: idx_contrat_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_idequipement ON sav.contrat USING btree (idequipement);


--
-- TOC entry 5589 (class 1259 OID 1511524)
-- Name: idx_contrat_idfacture; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_idfacture ON sav.contrat USING btree (idfacture);


--
-- TOC entry 5597 (class 1259 OID 1511525)
-- Name: idx_contrat_proposition_idcontrat; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_proposition_idcontrat ON sav.contrat_proposition USING btree (idcontrat);


--
-- TOC entry 5598 (class 1259 OID 1511526)
-- Name: idx_contrat_proposition_idcontrat_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_proposition_idcontrat_type ON sav.contrat_proposition USING btree (idcontrat_type);


--
-- TOC entry 5603 (class 1259 OID 1511527)
-- Name: idx_contrat_relance_idcontrat; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_relance_idcontrat ON sav.contrat_relance USING btree (idcontrat);


--
-- TOC entry 5608 (class 1259 OID 1511528)
-- Name: idx_contrat_tarif_idcontrat_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_tarif_idcontrat_type ON sav.contrat_tarif USING btree (idcontrat_type);


--
-- TOC entry 5609 (class 1259 OID 1511529)
-- Name: idx_contrat_tarif_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_contrat_tarif_idequipement_type ON sav.contrat_tarif USING btree (idequipement_type_puissance);


--
-- TOC entry 5616 (class 1259 OID 1511530)
-- Name: idx_courrier_client_idchaudiere; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_courrier_client_idchaudiere ON sav.courrier_client USING btree (idequipement);


--
-- TOC entry 5617 (class 1259 OID 1511531)
-- Name: idx_courrier_client_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_courrier_client_idintervention ON sav.courrier_client USING btree (idintervention);


--
-- TOC entry 5618 (class 1259 OID 1511532)
-- Name: idx_courrier_client_index_courrier_client; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_courrier_client_index_courrier_client ON sav.courrier_client USING btree (index_courrier_client);


--
-- TOC entry 5621 (class 1259 OID 1511533)
-- Name: idx_demande_documentation_code_agi; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_demande_documentation_code_agi ON sav.demande_documentation USING btree (code_agi);


--
-- TOC entry 5622 (class 1259 OID 1511534)
-- Name: idx_demande_documentation_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_demande_documentation_idequipement ON sav.demande_documentation USING btree (idequipement);


--
-- TOC entry 5623 (class 1259 OID 1511535)
-- Name: idx_demande_documentation_idtype_demandeur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_demande_documentation_idtype_demandeur ON sav.demande_documentation USING btree (idtype_demandeur);


--
-- TOC entry 5626 (class 1259 OID 1511536)
-- Name: idx_devis_idplanning; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_devis_idplanning ON sav.devis USING btree (idintervention);


--
-- TOC entry 5639 (class 1259 OID 1511537)
-- Name: idx_equipement_a_servir; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_a_servir ON sav.equipement USING btree (a_servir) WHERE (a_servir = true);


--
-- TOC entry 5640 (class 1259 OID 1511538)
-- Name: idx_equipement_actif; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_actif ON sav.equipement USING btree (actif) WHERE (actif = true);


--
-- TOC entry 5660 (class 1259 OID 1511539)
-- Name: idx_equipement_complement_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_complement_idequipement ON sav.equipement_complement USING btree (idequipement);


--
-- TOC entry 5661 (class 1259 OID 1511540)
-- Name: idx_equipement_complement_idtype_equipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_complement_idtype_equipement ON sav.equipement_complement USING btree (idtype_complement);


--
-- TOC entry 5641 (class 1259 OID 1511541)
-- Name: idx_equipement_famille; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_famille ON sav.equipement USING btree (idequipement_famille);


--
-- TOC entry 5642 (class 1259 OID 1511542)
-- Name: idx_equipement_famille_contrat; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_famille_contrat ON sav.equipement USING btree (idequipement_famille_contrat);


--
-- TOC entry 5674 (class 1259 OID 1511543)
-- Name: idx_equipement_groupe_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_groupe_idequipement ON sav.equipement_groupe USING btree (idequipement);


--
-- TOC entry 5675 (class 1259 OID 1511544)
-- Name: idx_equipement_groupe_idequipement_groupe_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_groupe_idequipement_groupe_type ON sav.equipement_groupe USING btree (idequipement_groupe_type);


--
-- TOC entry 5676 (class 1259 OID 1511545)
-- Name: idx_equipement_groupe_numero_groupe; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_groupe_numero_groupe ON sav.equipement_groupe USING btree (numero_groupe);


--
-- TOC entry 5681 (class 1259 OID 1511546)
-- Name: idx_equipement_hauteur_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_hauteur_idintervention ON sav.equipement_hauteur USING btree (idintervention);


--
-- TOC entry 5643 (class 1259 OID 1511547)
-- Name: idx_equipement_idadresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idadresse ON sav.equipement USING btree (idadresse);


--
-- TOC entry 5644 (class 1259 OID 1511548)
-- Name: idx_equipement_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idclient ON sav.equipement USING btree (idclient_souscripteur);


--
-- TOC entry 5645 (class 1259 OID 1511549)
-- Name: idx_equipement_idclientutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idclientutilisateur ON sav.equipement USING btree (idclient_utilisateur);


--
-- TOC entry 5646 (class 1259 OID 1511550)
-- Name: idx_equipement_idequipement_local; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idequipement_local ON sav.equipement USING btree (idequipement_local);


--
-- TOC entry 5647 (class 1259 OID 1511551)
-- Name: idx_equipement_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idequipement_type ON sav.equipement USING btree (idequipement_type_puissance);


--
-- TOC entry 5648 (class 1259 OID 1511552)
-- Name: idx_equipement_idinstallateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idinstallateur ON sav.equipement USING btree (idinstallateur);


--
-- TOC entry 5649 (class 1259 OID 1511553)
-- Name: idx_equipement_idnature_gaz; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idnature_gaz ON sav.equipement USING btree (idenergie);


--
-- TOC entry 5692 (class 1259 OID 1511554)
-- Name: idx_equipement_idoption; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idoption ON sav.equipement_option USING btree (idoption);


--
-- TOC entry 5650 (class 1259 OID 1511555)
-- Name: idx_equipement_idraccordement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idraccordement ON sav.equipement USING btree (idraccordement);


--
-- TOC entry 5651 (class 1259 OID 1511556)
-- Name: idx_equipement_idsecteur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idsecteur ON sav.equipement USING btree (idsecteur);


--
-- TOC entry 5652 (class 1259 OID 1511557)
-- Name: idx_equipement_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_idsite ON sav.equipement USING btree (idsite);


--
-- TOC entry 5653 (class 1259 OID 1511558)
-- Name: idx_equipement_num_serie_principal; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_num_serie_principal ON sav.equipement USING btree (num_serie_secondaire);


--
-- TOC entry 5693 (class 1259 OID 1511559)
-- Name: idx_equipement_option_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_option_idequipement ON sav.equipement_option USING btree (idequipement);


--
-- TOC entry 5694 (class 1259 OID 1511560)
-- Name: idx_equipement_option_idtarif_option; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_option_idtarif_option ON sav.equipement_option USING btree (idoption);


--
-- TOC entry 5699 (class 1259 OID 1511561)
-- Name: idx_equipement_pref_planification_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_pref_planification_idequipement ON sav.equipement_preferences_planification USING btree (idequipement);


--
-- TOC entry 5654 (class 1259 OID 1511562)
-- Name: idx_equipement_tranche_equipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_tranche_equipement ON sav.equipement USING btree (idequipement_tranche);


--
-- TOC entry 5712 (class 1259 OID 1511563)
-- Name: idx_equipement_type_famille_idequipement_famille; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_famille_idequipement_famille ON sav.equipement_type_famille USING btree (idequipement_famille);


--
-- TOC entry 5713 (class 1259 OID 1511564)
-- Name: idx_equipement_type_famille_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_famille_idequipement_type ON sav.equipement_type_famille USING btree (idequipement_type);


--
-- TOC entry 5716 (class 1259 OID 1511565)
-- Name: idx_equipement_type_option_idequipement_option; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_option_idequipement_option ON sav.equipement_type_option USING btree (idoption);


--
-- TOC entry 5717 (class 1259 OID 1511566)
-- Name: idx_equipement_type_option_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_option_idequipement_type ON sav.equipement_type_option USING btree (idequipement_type);


--
-- TOC entry 5720 (class 1259 OID 1511567)
-- Name: idx_equipement_type_puissance_idequipement_puissance; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_puissance_idequipement_puissance ON sav.equipement_type_puissance USING btree (idequipement_puissance);


--
-- TOC entry 5721 (class 1259 OID 1511568)
-- Name: idx_equipement_type_puissance_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_type_puissance_idequipement_type ON sav.equipement_type_puissance USING btree (idequipement_type);


--
-- TOC entry 5724 (class 1259 OID 1511569)
-- Name: idx_equipement_zone_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_zone_idequipement ON sav.equipement_zone USING btree (idequipement);


--
-- TOC entry 5725 (class 1259 OID 1511570)
-- Name: idx_equipement_zone_idtype_zone; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_equipement_zone_idtype_zone ON sav.equipement_zone USING btree (idtype_zone);


--
-- TOC entry 5728 (class 1259 OID 1511571)
-- Name: idx_etat_civil_libelle_court; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_etat_civil_libelle_court ON sav.etat_civil USING btree (libelle_court);


--
-- TOC entry 5739 (class 1259 OID 1511572)
-- Name: idx_facture_idadresse; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idadresse ON sav.facture USING btree (idadresse);


--
-- TOC entry 5740 (class 1259 OID 1511573)
-- Name: idx_facture_idagence; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idagence ON sav.facture USING btree (idagence);


--
-- TOC entry 5741 (class 1259 OID 1511574)
-- Name: idx_facture_idcategorie_facture; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idcategorie_facture ON sav.facture USING btree (idfacture_categorie);


--
-- TOC entry 5742 (class 1259 OID 1511575)
-- Name: idx_facture_iddevis; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_iddevis ON sav.facture USING btree (iddevis);


--
-- TOC entry 5743 (class 1259 OID 1511576)
-- Name: idx_facture_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idequipement ON sav.facture USING btree (idequipement);


--
-- TOC entry 5744 (class 1259 OID 1511577)
-- Name: idx_facture_idfacture_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idfacture_type ON sav.facture USING btree (idfacture_type);


--
-- TOC entry 5745 (class 1259 OID 1511578)
-- Name: idx_facture_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idintervention ON sav.facture USING btree (idintervention);


--
-- TOC entry 5746 (class 1259 OID 1511579)
-- Name: idx_facture_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_idsite ON sav.facture USING btree (idsite);


--
-- TOC entry 5749 (class 1259 OID 1511580)
-- Name: idx_facture_ligne_idfacture; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_ligne_idfacture ON sav.facture_ligne USING btree (idfacture);


--
-- TOC entry 5750 (class 1259 OID 1511581)
-- Name: idx_facture_ligne_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_ligne_idproduit ON sav.facture_ligne USING btree (idproduit);


--
-- TOC entry 5751 (class 1259 OID 1511582)
-- Name: idx_facture_ligne_idproduit_facture_affectation; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_ligne_idproduit_facture_affectation ON sav.facture_ligne USING btree (idproduit_facture_affectation);


--
-- TOC entry 5754 (class 1259 OID 1511583)
-- Name: idx_facture_relance_idfacture; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_facture_relance_idfacture ON sav.facture_relance USING btree (idfacture);


--
-- TOC entry 5765 (class 1259 OID 1511584)
-- Name: idx_groupe_idgroupe_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_groupe_idgroupe_type ON sav.groupe USING btree (idgroupe_type);


--
-- TOC entry 5766 (class 1259 OID 1511585)
-- Name: idx_groupe_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_groupe_idsite ON sav.groupe USING btree (idsite);


--
-- TOC entry 5767 (class 1259 OID 1511586)
-- Name: idx_groupe_idutilisateur_admin_groupe; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_groupe_idutilisateur_admin_groupe ON sav.groupe USING btree (idutilisateur_admin_groupe);


--
-- TOC entry 5774 (class 1259 OID 1511587)
-- Name: idx_groupe_utilisateur_idgroupe; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_groupe_utilisateur_idgroupe ON sav.groupe_utilisateur USING btree (idgroupe);


--
-- TOC entry 5775 (class 1259 OID 1511588)
-- Name: idx_groupe_utilisateur_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_groupe_utilisateur_idutilisateur ON sav.groupe_utilisateur USING btree (idutilisateur);


--
-- TOC entry 5778 (class 1259 OID 1511589)
-- Name: idx_historique_client_equipement_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_client_equipement_idclient ON sav.historique_client_equipement USING btree (idclient);


--
-- TOC entry 5779 (class 1259 OID 1511590)
-- Name: idx_historique_client_equipement_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_client_equipement_idequipement ON sav.historique_client_equipement USING btree (idequipement);


--
-- TOC entry 5780 (class 1259 OID 1511591)
-- Name: idx_historique_client_equipement_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_client_equipement_idintervention ON sav.historique_client_equipement USING btree (idintervention);


--
-- TOC entry 5781 (class 1259 OID 1511592)
-- Name: idx_historique_client_equipement_idsouscripteur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_client_equipement_idsouscripteur ON sav.historique_client_equipement USING btree (idsouscripteur);


--
-- TOC entry 5784 (class 1259 OID 1511593)
-- Name: idx_historique_equipement_local_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_equipement_local_idintervention ON sav.historique_equipement_local USING btree (idintervention);


--
-- TOC entry 5789 (class 1259 OID 1511594)
-- Name: idx_historique_modification_effectuee; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_modification_effectuee ON sav.historique_modification USING btree (effectuee);


--
-- TOC entry 5790 (class 1259 OID 1511595)
-- Name: idx_historique_modification_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_modification_idclient ON sav.historique_modification USING btree (idclient);


--
-- TOC entry 5791 (class 1259 OID 1511596)
-- Name: idx_historique_modification_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_modification_idequipement ON sav.historique_modification USING btree (idequipement);


--
-- TOC entry 5792 (class 1259 OID 1511597)
-- Name: idx_historique_modification_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_modification_idintervention ON sav.historique_modification USING btree (idintervention);


--
-- TOC entry 5793 (class 1259 OID 1511598)
-- Name: idx_historique_modification_idutilisateur_modif; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_historique_modification_idutilisateur_modif ON sav.historique_modification USING btree (idutilisateur_modif);


--
-- TOC entry 5558 (class 1259 OID 1511599)
-- Name: idx_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_idclient ON sav.client_site USING btree (idclient);


--
-- TOC entry 5559 (class 1259 OID 1511600)
-- Name: idx_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_idsite ON sav.client_site USING btree (idsite);


--
-- TOC entry 5796 (class 1259 OID 1511601)
-- Name: idx_installateur_adresse1; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_installateur_adresse1 ON sav.installateur USING btree (adresse1);


--
-- TOC entry 5797 (class 1259 OID 1511602)
-- Name: idx_installateur_nom; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_installateur_nom ON sav.installateur USING btree (nom);


--
-- TOC entry 5817 (class 1259 OID 1511603)
-- Name: idx_intervention_annulation_idintervention_motif_abandon; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_annulation_idintervention_motif_abandon ON sav.intervention_annulation USING btree (idintervention_motif_abandon);


--
-- TOC entry 5818 (class 1259 OID 1511604)
-- Name: idx_intervention_annulation_idintervention_motif_absence; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_annulation_idintervention_motif_absence ON sav.intervention_annulation USING btree (idintervention_motif_absence);


--
-- TOC entry 5819 (class 1259 OID 1511605)
-- Name: idx_intervention_annulation_idintervention_motif_annulation; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_annulation_idintervention_motif_annulation ON sav.intervention_annulation USING btree (idintervention_motif_annulation);


--
-- TOC entry 5824 (class 1259 OID 1511606)
-- Name: idx_intervention_document_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_document_idintervention ON sav.intervention_document USING btree (idintervention);


--
-- TOC entry 5802 (class 1259 OID 1511607)
-- Name: idx_intervention_equipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_equipement ON sav.intervention USING btree (idequipement, idtype_planification);


--
-- TOC entry 5803 (class 1259 OID 1511608)
-- Name: idx_intervention_idclient_payeur_tiers; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idclient_payeur_tiers ON sav.intervention USING btree (idclient_payeur_tiers);


--
-- TOC entry 5804 (class 1259 OID 1511609)
-- Name: idx_intervention_idcontrat_tarif; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idcontrat_tarif ON sav.intervention USING btree (idcontrat_tarif);


--
-- TOC entry 5805 (class 1259 OID 1511610)
-- Name: idx_intervention_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idequipement ON sav.intervention USING btree (idequipement);


--
-- TOC entry 5806 (class 1259 OID 1511611)
-- Name: idx_intervention_idintervention_motif; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idintervention_motif ON sav.intervention USING btree (idintervention_motif);


--
-- TOC entry 5807 (class 1259 OID 1511612)
-- Name: idx_intervention_idtype_envoi_rapport; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idtype_envoi_rapport ON sav.intervention USING btree (idtype_envoi_rapport);


--
-- TOC entry 5808 (class 1259 OID 1511613)
-- Name: idx_intervention_idtype_planification_init; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idtype_planification_init ON sav.intervention USING btree (idtype_planification);


--
-- TOC entry 5809 (class 1259 OID 1511614)
-- Name: idx_intervention_idtype_validation_adm; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idtype_validation_adm ON sav.intervention USING btree (idtype_validation_adm);


--
-- TOC entry 5810 (class 1259 OID 1511615)
-- Name: idx_intervention_idtype_validation_technique; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_idtype_validation_technique ON sav.intervention USING btree (idtype_validation_technique);


--
-- TOC entry 5827 (class 1259 OID 1511616)
-- Name: idx_intervention_media_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_media_idintervention ON sav.intervention_media USING btree (idintervention);


--
-- TOC entry 5811 (class 1259 OID 1511617)
-- Name: idx_intervention_planning_validation_adm; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_planning_validation_adm ON sav.intervention USING btree (idplanning, date_validation_adm) WHERE (date_validation_adm IS NULL);


--
-- TOC entry 5812 (class 1259 OID 1511618)
-- Name: idx_intervention_planning_validation_technique; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_planning_validation_technique ON sav.intervention USING btree (idplanning, date_validation_technique) WHERE (date_validation_technique IS NULL);


--
-- TOC entry 5842 (class 1259 OID 1511619)
-- Name: idx_intervention_pre_encaissement_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_pre_encaissement_idintervention ON sav.intervention_pre_encaissement USING btree (idintervention);


--
-- TOC entry 5843 (class 1259 OID 1511620)
-- Name: idx_intervention_pre_encaissement_idmoyen_paiement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_pre_encaissement_idmoyen_paiement ON sav.intervention_pre_encaissement USING btree (idmoyen_paiement);


--
-- TOC entry 5844 (class 1259 OID 1511621)
-- Name: idx_intervention_pre_encaissement_intervention_pre_encaissement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_pre_encaissement_intervention_pre_encaissement ON sav.intervention_pre_encaissement USING btree (idutilisateur_responsable, date_reception);


--
-- TOC entry 5847 (class 1259 OID 1511622)
-- Name: idx_intervention_stack_idagent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_intervention_stack_idagent ON sav.intervention_stack USING btree (idagent);


--
-- TOC entry 5868 (class 1259 OID 1511623)
-- Name: idx_mag_commande_histo_idmag_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_histo_idmag_commande ON sav.mag_commande_histo USING btree (idmag_commande);


--
-- TOC entry 5869 (class 1259 OID 1511624)
-- Name: idx_mag_commande_histo_idmag_etat_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_histo_idmag_etat_commande ON sav.mag_commande_histo USING btree (idmag_etat_commande);


--
-- TOC entry 5870 (class 1259 OID 1511625)
-- Name: idx_mag_commande_histo_idmag_statut_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_histo_idmag_statut_commande ON sav.mag_commande_histo USING btree (idmag_statut_commande);


--
-- TOC entry 5871 (class 1259 OID 1511626)
-- Name: idx_mag_commande_histo_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_histo_idutilisateur ON sav.mag_commande_histo USING btree (idutilisateur);


--
-- TOC entry 5857 (class 1259 OID 1511627)
-- Name: idx_mag_commande_idagence; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idagence ON sav.mag_commande USING btree (idagence);


--
-- TOC entry 5858 (class 1259 OID 1511628)
-- Name: idx_mag_commande_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idequipement ON sav.mag_commande USING btree (idequipement);


--
-- TOC entry 5859 (class 1259 OID 1511629)
-- Name: idx_mag_commande_idintervention; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idintervention ON sav.mag_commande USING btree (idintervention);


--
-- TOC entry 5860 (class 1259 OID 1511630)
-- Name: idx_mag_commande_idmag_etat_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idmag_etat_commande ON sav.mag_commande USING btree (idmag_etat_commande);


--
-- TOC entry 5861 (class 1259 OID 1511631)
-- Name: idx_mag_commande_idmag_statut_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idmag_statut_commande ON sav.mag_commande USING btree (idmag_statut_commande);


--
-- TOC entry 5862 (class 1259 OID 1511632)
-- Name: idx_mag_commande_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idsite ON sav.mag_commande USING btree (idsite);


--
-- TOC entry 5863 (class 1259 OID 1511633)
-- Name: idx_mag_commande_idsite_livraison; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idsite_livraison ON sav.mag_commande USING btree (idsite_livraison);


--
-- TOC entry 5864 (class 1259 OID 1511634)
-- Name: idx_mag_commande_idtype_cde; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idtype_cde ON sav.mag_commande USING btree (idtype_cde);


--
-- TOC entry 5865 (class 1259 OID 1511635)
-- Name: idx_mag_commande_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_commande_idutilisateur ON sav.mag_commande USING btree (idutilisateur);


--
-- TOC entry 5880 (class 1259 OID 1511636)
-- Name: idx_mag_jour_exclusion_livraison_idagence; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_jour_exclusion_livraison_idagence ON sav.mag_jour_exclusion_livraison USING btree (idagence);


--
-- TOC entry 5883 (class 1259 OID 1511637)
-- Name: idx_mag_ligne_commande_idmag_commande; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_ligne_commande_idmag_commande ON sav.mag_ligne_commande USING btree (idmag_commande);


--
-- TOC entry 5884 (class 1259 OID 1511638)
-- Name: idx_mag_ligne_commande_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_ligne_commande_idproduit ON sav.mag_ligne_commande USING btree (idproduit);


--
-- TOC entry 5889 (class 1259 OID 1511639)
-- Name: idx_mag_stock_mouvement_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_stock_mouvement_idproduit ON sav.mag_stock_mouvement USING btree (idproduit);


--
-- TOC entry 5890 (class 1259 OID 1511640)
-- Name: idx_mag_stock_mouvement_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_stock_mouvement_idsite ON sav.mag_stock_mouvement USING btree (idsite);


--
-- TOC entry 5891 (class 1259 OID 1511641)
-- Name: idx_mag_stock_mouvement_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_mag_stock_mouvement_idutilisateur ON sav.mag_stock_mouvement USING btree (idutilisateur);


--
-- TOC entry 5918 (class 1259 OID 1511642)
-- Name: idx_paiement_idfacture; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_paiement_idfacture ON sav.paiement USING btree (idfacture);


--
-- TOC entry 5919 (class 1259 OID 1511643)
-- Name: idx_paiement_idmoyen_paiement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_paiement_idmoyen_paiement ON sav.paiement USING btree (idmoyen_paiement);


--
-- TOC entry 5938 (class 1259 OID 1511644)
-- Name: idx_planning_blocage; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_blocage ON sav.planning_blocage USING btree (idutilisateur_agent_bloque, idutilisateur_blocage);


--
-- TOC entry 5945 (class 1259 OID 1511645)
-- Name: idx_planning_historique_modification_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_historique_modification_idequipement ON sav.planning_historique_modification USING btree (idequipement);


--
-- TOC entry 5946 (class 1259 OID 1511646)
-- Name: idx_planning_historique_modification_idmoment; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_historique_modification_idmoment ON sav.planning_historique_modification USING btree (idmoment_passage);


--
-- TOC entry 5947 (class 1259 OID 1511647)
-- Name: idx_planning_historique_modification_idplanning; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_historique_modification_idplanning ON sav.planning_historique_modification USING btree (idplanning);


--
-- TOC entry 5948 (class 1259 OID 1511648)
-- Name: idx_planning_historique_modification_idtype_planification; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_historique_modification_idtype_planification ON sav.planning_historique_modification USING btree (idtype_planification);


--
-- TOC entry 5949 (class 1259 OID 1511649)
-- Name: idx_planning_historique_modification_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_historique_modification_idutilisateur ON sav.planning_historique_modification USING btree (idutilisateur);


--
-- TOC entry 5924 (class 1259 OID 1511650)
-- Name: idx_planning_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idequipement ON sav.planning USING btree (idequipement);


--
-- TOC entry 5925 (class 1259 OID 1511651)
-- Name: idx_planning_idhoraire_passage; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idhoraire_passage ON sav.planning USING btree (idhoraire_passage);


--
-- TOC entry 5926 (class 1259 OID 1511652)
-- Name: idx_planning_idmoment_passage; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idmoment_passage ON sav.planning USING btree (idmoment_passage);


--
-- TOC entry 5927 (class 1259 OID 1511653)
-- Name: idx_planning_idtype_planification; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idtype_planification ON sav.planning USING btree (idtype_planification_init);


--
-- TOC entry 5928 (class 1259 OID 1511654)
-- Name: idx_planning_idutilisateur_agent; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idutilisateur_agent ON sav.planning USING btree (idutilisateur_agent);


--
-- TOC entry 5929 (class 1259 OID 1511655)
-- Name: idx_planning_idutilisateur_planning; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_planning_idutilisateur_planning ON sav.planning USING btree (idutilisateur_planning);


--
-- TOC entry 5960 (class 1259 OID 1511656)
-- Name: idx_po_idclient; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_po_idclient ON sav.porte_ouverte USING btree (idclient);


--
-- TOC entry 5961 (class 1259 OID 1511657)
-- Name: idx_porte_ouverte_idclient_id; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_porte_ouverte_idclient_id ON sav.porte_ouverte USING btree (id, idclient);


--
-- TOC entry 5964 (class 1259 OID 1511658)
-- Name: idx_privilege_idraison_refus; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_privilege_idraison_refus ON sav.privilege USING btree (idraison_refus);


--
-- TOC entry 5965 (class 1259 OID 1511659)
-- Name: idx_privilege_statut_privilege; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_privilege_statut_privilege ON sav.privilege USING btree (idprivilege_statut);


--
-- TOC entry 5981 (class 1259 OID 1511660)
-- Name: idx_produit_famille_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_famille_idsite ON sav.produit_famille USING btree (idsite);


--
-- TOC entry 5974 (class 1259 OID 1511661)
-- Name: idx_produit_idproduit_famille; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_idproduit_famille ON sav.produit USING btree (idfamille_agi);


--
-- TOC entry 5975 (class 1259 OID 1511662)
-- Name: idx_produit_idproduit_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_idproduit_type ON sav.produit USING btree (idproduit_type);


--
-- TOC entry 5976 (class 1259 OID 1511663)
-- Name: idx_produit_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_idsite ON sav.produit USING btree (idsite);


--
-- TOC entry 5984 (class 1259 OID 1511664)
-- Name: idx_produit_photo_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_photo_idproduit ON sav.produit_photo USING btree (idproduit);


--
-- TOC entry 5987 (class 1259 OID 1511665)
-- Name: idx_produit_prestation_tarif_idcontrat_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_prestation_tarif_idcontrat_type ON sav.produit_prestation_tarif USING btree (idcontrat_regroupement);


--
-- TOC entry 5988 (class 1259 OID 1511666)
-- Name: idx_produit_prestation_tarif_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_prestation_tarif_idproduit ON sav.produit_prestation_tarif USING btree (idproduit);


--
-- TOC entry 5991 (class 1259 OID 1511667)
-- Name: idx_produit_stock_site_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_stock_site_idproduit ON sav.produit_stock_site USING btree (idproduit);


--
-- TOC entry 5992 (class 1259 OID 1511668)
-- Name: idx_produit_stock_site_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_produit_stock_site_idsite ON sav.produit_stock_site USING btree (idsite);


--
-- TOC entry 6001 (class 1259 OID 1511669)
-- Name: idx_retour_idtype_retour; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_retour_idtype_retour ON sav.retour USING btree (idtype_retour);


--
-- TOC entry 6016 (class 1259 OID 1511670)
-- Name: idx_secteur_equipement_idequipement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_equipement_idequipement ON sav.secteur_equipement USING btree (idequipement);


--
-- TOC entry 6017 (class 1259 OID 1511671)
-- Name: idx_secteur_equipement_idsecteur_version; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_equipement_idsecteur_version ON sav.secteur_equipement USING btree (idsecteur);


--
-- TOC entry 6006 (class 1259 OID 1511672)
-- Name: idx_secteur_idsecteur_activite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idsecteur_activite ON sav.secteur USING btree (idsecteur_activite);


--
-- TOC entry 6007 (class 1259 OID 1511673)
-- Name: idx_secteur_idsecteur_tarif; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idsecteur_tarif ON sav.secteur USING btree (idsecteur_zone);


--
-- TOC entry 6008 (class 1259 OID 1511674)
-- Name: idx_secteur_idsecteur_taux_retour; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idsecteur_taux_retour ON sav.secteur USING btree (idsecteur_taux_retour);


--
-- TOC entry 6009 (class 1259 OID 1511675)
-- Name: idx_secteur_idsecteur_version; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idsecteur_version ON sav.secteur USING btree (numero, idsectorisation_version);


--
-- TOC entry 6010 (class 1259 OID 1511676)
-- Name: idx_secteur_idsectorisation_version; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idsectorisation_version ON sav.secteur USING btree (idsectorisation_version);


--
-- TOC entry 6011 (class 1259 OID 1511677)
-- Name: idx_secteur_idutilisateur_planning; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_secteur_idutilisateur_planning ON sav.secteur USING btree (idutilisateur_planning);


--
-- TOC entry 6026 (class 1259 OID 1511678)
-- Name: idx_sectorisation_version_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_sectorisation_version_idsite ON sav.sectorisation_version USING btree (idsite);


--
-- TOC entry 6027 (class 1259 OID 1511679)
-- Name: idx_sectorisation_version_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_sectorisation_version_idutilisateur ON sav.sectorisation_version USING btree (idutilisateur);


--
-- TOC entry 6030 (class 1259 OID 1511680)
-- Name: idx_site_nom; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_site_nom ON sav.site USING btree (nom);


--
-- TOC entry 6035 (class 1259 OID 1511681)
-- Name: idx_stock_standard_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_stock_standard_idsite ON sav.stock_standard USING btree (idsite);


--
-- TOC entry 6038 (class 1259 OID 1511682)
-- Name: idx_stock_standard_produit_idproduit; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_stock_standard_produit_idproduit ON sav.stock_standard_produit USING btree (idproduit);


--
-- TOC entry 6039 (class 1259 OID 1511683)
-- Name: idx_stock_standard_produit_idstock_standard; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_stock_standard_produit_idstock_standard ON sav.stock_standard_produit USING btree (idstock_standard);


--
-- TOC entry 5914 (class 1259 OID 1511684)
-- Name: idx_tarif_option_idequipement_type; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_tarif_option_idequipement_type ON sav.option_tarif USING btree (idcontrat_type);


--
-- TOC entry 5915 (class 1259 OID 1511685)
-- Name: idx_tarif_option_idoption; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_tarif_option_idoption ON sav.option_tarif USING btree (idoption);


--
-- TOC entry 6046 (class 1259 OID 1511686)
-- Name: idx_tchat_message_idgroupe; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_tchat_message_idgroupe ON sav.tchat_message USING btree (idgroupe);


--
-- TOC entry 6047 (class 1259 OID 1511687)
-- Name: idx_tchat_message_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_tchat_message_idutilisateur ON sav.tchat_message USING btree (idutilisateur);


--
-- TOC entry 6080 (class 1259 OID 1511688)
-- Name: idx_type_client_libelle; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_type_client_libelle ON sav.type_client USING btree (libelle);


--
-- TOC entry 6103 (class 1259 OID 1511689)
-- Name: idx_type_logement; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_type_logement ON sav.type_logement USING btree (libelle);


--
-- TOC entry 6110 (class 1259 OID 1511690)
-- Name: idx_type_planif_code; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_type_planif_code ON sav.type_planification USING btree (code) WHERE ((code)::text = 'V1'::text);


--
-- TOC entry 6113 (class 1259 OID 1511691)
-- Name: idx_type_planification_type_appareil_idtype_appareil; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_type_planification_type_appareil_idtype_appareil ON sav.type_planification_type_appareil USING btree (idtype_appareil);


--
-- TOC entry 6114 (class 1259 OID 1511692)
-- Name: idx_type_planification_type_appareil_idtype_planification; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_type_planification_type_appareil_idtype_planification ON sav.type_planification_type_appareil USING btree (idtype_planification);


--
-- TOC entry 6136 (class 1259 OID 1511693)
-- Name: idx_utilisateur_affectation_idmotif_temps_partiel; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idmotif_temps_partiel ON sav.utilisateur_affectation USING btree (idmotif_temps_partiel);


--
-- TOC entry 6137 (class 1259 OID 1511694)
-- Name: idx_utilisateur_affectation_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idutilisateur ON sav.utilisateur_affectation USING btree (idutilisateur);


--
-- TOC entry 6138 (class 1259 OID 1511695)
-- Name: idx_utilisateur_affectation_idutilisateur_binome; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idutilisateur_binome ON sav.utilisateur_affectation USING btree (idutilisateur_binome);


--
-- TOC entry 6139 (class 1259 OID 1511696)
-- Name: idx_utilisateur_affectation_idutilisateur_planning; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idutilisateur_planning ON sav.utilisateur_affectation USING btree (idutilisateur_planning);


--
-- TOC entry 6140 (class 1259 OID 1511697)
-- Name: idx_utilisateur_affectation_idutilisateur_profil; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idutilisateur_profil ON sav.utilisateur_affectation USING btree (idutilisateur_profil);


--
-- TOC entry 6141 (class 1259 OID 1511698)
-- Name: idx_utilisateur_affectation_idutilisateur_responsable; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_affectation_idutilisateur_responsable ON sav.utilisateur_affectation USING btree (idutilisateur_responsable);


--
-- TOC entry 6144 (class 1259 OID 1511699)
-- Name: idx_utilisateur_email_idtype_email; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_email_idtype_email ON sav.utilisateur_email USING btree (idtype_email);


--
-- TOC entry 6145 (class 1259 OID 1511700)
-- Name: idx_utilisateur_email_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_email_idutilisateur ON sav.utilisateur_email USING btree (idutilisateur);


--
-- TOC entry 6128 (class 1259 OID 1511701)
-- Name: idx_utilisateur_idagence; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_idagence ON sav.utilisateur USING btree (idagence);


--
-- TOC entry 6129 (class 1259 OID 1511702)
-- Name: idx_utilisateur_idtype_login; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_idtype_login ON sav.utilisateur USING btree (idtype_login);


--
-- TOC entry 6130 (class 1259 OID 1511703)
-- Name: idx_utilisateur_idtype_utilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_idtype_utilisateur ON sav.utilisateur USING btree (idtype_utilisateur);


--
-- TOC entry 6131 (class 1259 OID 1511704)
-- Name: idx_utilisateur_idutilisateur_valide_conges; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_idutilisateur_valide_conges ON sav.utilisateur USING btree (idutilisateur_valide_conges);


--
-- TOC entry 6154 (class 1259 OID 1511705)
-- Name: idx_utilisateur_site_idsite; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_site_idsite ON sav.utilisateur_site USING btree (idsite);


--
-- TOC entry 6155 (class 1259 OID 1511706)
-- Name: idx_utilisateur_site_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_site_idutilisateur ON sav.utilisateur_site USING btree (idutilisateur);


--
-- TOC entry 6158 (class 1259 OID 1511707)
-- Name: idx_utilisateur_tel_idtype_tel; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_tel_idtype_tel ON sav.utilisateur_tel USING btree (idtype_tel);


--
-- TOC entry 6159 (class 1259 OID 1511708)
-- Name: idx_utilisateur_tel_idutilisateur; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX idx_utilisateur_tel_idutilisateur ON sav.utilisateur_tel USING btree (idutilisateur);


--
-- TOC entry 5655 (class 1259 OID 1511709)
-- Name: test; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX test ON sav.equipement USING btree (idclient_souscripteur, idclient_utilisateur, actif);


--
-- TOC entry 5590 (class 1259 OID 1511710)
-- Name: test tretr; Type: INDEX; Schema: sav; Owner: frisquet
--

CREATE INDEX "test tretr" ON sav.contrat USING btree (date_debut_contrat);


--
-- TOC entry 6475 (class 2606 OID 1511711)
-- Name: tmp_correspondance_agent 	 tmp_correspondance_agent_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_agent
    ADD CONSTRAINT "	 tmp_correspondance_agent_idsite_fkey" FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6164 (class 2606 OID 1511716)
-- Name: adresse_complement adresse_complement_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse_complement
    ADD CONSTRAINT adresse_complement_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6165 (class 2606 OID 1511721)
-- Name: adresse_complement adresse_complement_idtype_complement_adresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse_complement
    ADD CONSTRAINT adresse_complement_idtype_complement_adresse_fkey FOREIGN KEY (idtype_complement_adresse) REFERENCES sav.type_complement_adresse(id);


--
-- TOC entry 6162 (class 2606 OID 1511726)
-- Name: adresse adresse_idtype_adresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse
    ADD CONSTRAINT adresse_idtype_adresse_fkey FOREIGN KEY (idtype_adresse) REFERENCES sav.type_adresse(id);


--
-- TOC entry 6163 (class 2606 OID 1511731)
-- Name: adresse adresse_idtype_logement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.adresse
    ADD CONSTRAINT adresse_idtype_logement_fkey FOREIGN KEY (idtype_logement) REFERENCES sav.type_logement(id);


--
-- TOC entry 6167 (class 2606 OID 1511736)
-- Name: agence_adresse agence_adresse_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence_adresse
    ADD CONSTRAINT agence_adresse_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6168 (class 2606 OID 1511741)
-- Name: agence_adresse agence_adresse_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence_adresse
    ADD CONSTRAINT agence_adresse_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6166 (class 2606 OID 1511746)
-- Name: agence agence_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agence
    ADD CONSTRAINT agence_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6169 (class 2606 OID 1511751)
-- Name: agent_appareil agent_appareil_idappareil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_appareil
    ADD CONSTRAINT agent_appareil_idappareil_fkey FOREIGN KEY (idappareil) REFERENCES sav.appareil(id);


--
-- TOC entry 6170 (class 2606 OID 1511756)
-- Name: agent_appareil agent_appareil_idutilisateur_agent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_appareil
    ADD CONSTRAINT agent_appareil_idutilisateur_agent_fkey FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6171 (class 2606 OID 1511761)
-- Name: agent_gps agent_gps_idutilisateur_agent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_gps
    ADD CONSTRAINT agent_gps_idutilisateur_agent_fkey FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6172 (class 2606 OID 1511766)
-- Name: agent_produit_stock agent_produit_stock_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_produit_stock
    ADD CONSTRAINT agent_produit_stock_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6173 (class 2606 OID 1511771)
-- Name: agent_produit_stock agent_produit_stock_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_produit_stock
    ADD CONSTRAINT agent_produit_stock_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6174 (class 2606 OID 1511776)
-- Name: agent_qualification agent_qualification_idequipement_famille_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_qualification
    ADD CONSTRAINT agent_qualification_idequipement_famille_fkey FOREIGN KEY (idequipement_famille) REFERENCES sav.equipement_famille(id) NOT VALID;


--
-- TOC entry 6175 (class 2606 OID 1511781)
-- Name: agent_qualification agent_qualification_idutilisateur_agent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_qualification
    ADD CONSTRAINT agent_qualification_idutilisateur_agent_fkey FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6176 (class 2606 OID 1511786)
-- Name: agent_restriction agent_restriction_idtype_planification_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_restriction
    ADD CONSTRAINT agent_restriction_idtype_planification_fkey FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6177 (class 2606 OID 1511791)
-- Name: agent_restriction agent_restriction_idutilisateur_agent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_restriction
    ADD CONSTRAINT agent_restriction_idutilisateur_agent_fkey FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6178 (class 2606 OID 1511796)
-- Name: agent_secteur agent_secteur_idsecteur_version_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_secteur
    ADD CONSTRAINT agent_secteur_idsecteur_version_fkey FOREIGN KEY (idsecteur_version) REFERENCES sav.secteur(id);


--
-- TOC entry 6179 (class 2606 OID 1511801)
-- Name: agent_secteur agent_secteur_idutilisateur_agent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.agent_secteur
    ADD CONSTRAINT agent_secteur_idutilisateur_agent_fkey FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6183 (class 2606 OID 1511806)
-- Name: aide_technique_classification aide_technique_classification_idaide_technique_classificat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_classification
    ADD CONSTRAINT aide_technique_classification_idaide_technique_classificat_fkey FOREIGN KEY (idaide_technique_classification_liste) REFERENCES sav.aide_technique_classification_liste(id);


--
-- TOC entry 6184 (class 2606 OID 1511811)
-- Name: aide_technique_classification aide_technique_classification_idaide_technique_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_classification
    ADD CONSTRAINT aide_technique_classification_idaide_technique_fkey FOREIGN KEY (idaide_technique) REFERENCES sav.aide_technique(id);


--
-- TOC entry 6185 (class 2606 OID 1511816)
-- Name: aide_technique_histo aide_technique_histo_idaide_technique_etat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_histo
    ADD CONSTRAINT aide_technique_histo_idaide_technique_etat_fkey FOREIGN KEY (idaide_technique_etat) REFERENCES sav.aide_technique_etat(id);


--
-- TOC entry 6186 (class 2606 OID 1511821)
-- Name: aide_technique_histo aide_technique_histo_idaide_technique_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_histo
    ADD CONSTRAINT aide_technique_histo_idaide_technique_fkey FOREIGN KEY (idaide_technique) REFERENCES sav.aide_technique(id);


--
-- TOC entry 6187 (class 2606 OID 1511826)
-- Name: aide_technique_histo aide_technique_histo_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique_histo
    ADD CONSTRAINT aide_technique_histo_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6180 (class 2606 OID 1511831)
-- Name: aide_technique aide_technique_idaide_technique_etat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique
    ADD CONSTRAINT aide_technique_idaide_technique_etat_fkey FOREIGN KEY (idaide_technique_etat) REFERENCES sav.aide_technique_etat(id);


--
-- TOC entry 6181 (class 2606 OID 1511836)
-- Name: aide_technique aide_technique_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique
    ADD CONSTRAINT aide_technique_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6182 (class 2606 OID 1511841)
-- Name: aide_technique aide_technique_idtype_demandeur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.aide_technique
    ADD CONSTRAINT aide_technique_idtype_demandeur_fkey FOREIGN KEY (idtype_demandeur) REFERENCES sav.type_demandeur(id);


--
-- TOC entry 6188 (class 2606 OID 1511846)
-- Name: anomalie anomalie_idanomalie_categorie_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_idanomalie_categorie_fkey FOREIGN KEY (idanomalie_categorie) REFERENCES sav.anomalie_categorie(id);


--
-- TOC entry 6189 (class 2606 OID 1511851)
-- Name: anomalie anomalie_idanomalie_classification_ancien_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_idanomalie_classification_ancien_fkey FOREIGN KEY (idanomalie_classification_ancien) REFERENCES sav.anomalie_classification(id);


--
-- TOC entry 6190 (class 2606 OID 1511856)
-- Name: anomalie anomalie_idanomalie_classification_neuve_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_idanomalie_classification_neuve_fkey FOREIGN KEY (idanomalie_classification_neuve) REFERENCES sav.anomalie_classification(id);


--
-- TOC entry 6191 (class 2606 OID 1511861)
-- Name: anomalie anomalie_idanomalie_coupure_gaz_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_idanomalie_coupure_gaz_fkey FOREIGN KEY (idanomalie_coupure_gaz) REFERENCES sav.anomalie_coupure_gaz(id);


--
-- TOC entry 6192 (class 2606 OID 1511866)
-- Name: anomalie anomalie_idanomalie_pro_contact_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.anomalie
    ADD CONSTRAINT anomalie_idanomalie_pro_contact_fkey FOREIGN KEY (idanomalie_pro_contact) REFERENCES sav.anomalie_pro_contact(id);


--
-- TOC entry 6193 (class 2606 OID 1511871)
-- Name: appareil appareil_idsite; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.appareil
    ADD CONSTRAINT appareil_idsite FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6194 (class 2606 OID 1511876)
-- Name: appareil appareil_idtype_appareil; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.appareil
    ADD CONSTRAINT appareil_idtype_appareil FOREIGN KEY (idtype_appareil) REFERENCES sav.type_appareil(id) NOT VALID;


--
-- TOC entry 6195 (class 2606 OID 1511881)
-- Name: attachement_parametre attachement_parametre_idattachement_parametre_liste_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_parametre
    ADD CONSTRAINT attachement_parametre_idattachement_parametre_liste_fkey FOREIGN KEY (idattachement_parametre_liste) REFERENCES sav.attachement_parametre_liste(id);


--
-- TOC entry 6196 (class 2606 OID 1511886)
-- Name: attachement_profil attachement_profil_idutilisateur_profil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_profil
    ADD CONSTRAINT attachement_profil_idutilisateur_profil_fkey FOREIGN KEY (idutilisateur_profil) REFERENCES sav.utilisateur_profil(id);


--
-- TOC entry 6197 (class 2606 OID 1511891)
-- Name: attachement_type_planification attachement_type_planification_idtype_planification_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attachement_type_planification
    ADD CONSTRAINT attachement_type_planification_idtype_planification_fkey FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6198 (class 2606 OID 1511896)
-- Name: attestation_entretien_conseil attestation_entretien_conseil_idattestation_entretien_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_conseil
    ADD CONSTRAINT attestation_entretien_conseil_idattestation_entretien_fkey FOREIGN KEY (idattestation_entretien) REFERENCES sav.attestation_entretien(id);


--
-- TOC entry 6199 (class 2606 OID 1511901)
-- Name: attestation_entretien_conseil attestation_entretien_conseil_idconseil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_conseil
    ADD CONSTRAINT attestation_entretien_conseil_idconseil_fkey FOREIGN KEY (idconseil) REFERENCES sav.conseil(id);


--
-- TOC entry 6200 (class 2606 OID 1511906)
-- Name: attestation_entretien_point_controle attestation_entretien_point_controle_idattestation_entretien_fk; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_point_controle
    ADD CONSTRAINT attestation_entretien_point_controle_idattestation_entretien_fk FOREIGN KEY (idattestation_entretien) REFERENCES sav.attestation_entretien(id);


--
-- TOC entry 6201 (class 2606 OID 1511911)
-- Name: attestation_entretien_point_controle attestation_entretien_point_controle_idpoint_controle_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.attestation_entretien_point_controle
    ADD CONSTRAINT attestation_entretien_point_controle_idpoint_controle_fkey FOREIGN KEY (idpoint_controle) REFERENCES sav.point_controle(id);


--
-- TOC entry 6203 (class 2606 OID 1511916)
-- Name: classification_energetique classification_energetique_idclasse_energetique_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classification_energetique
    ADD CONSTRAINT classification_energetique_idclasse_energetique_fkey FOREIGN KEY (idclasse_energetique) REFERENCES sav.classe_energetique(id);


--
-- TOC entry 6204 (class 2606 OID 1511921)
-- Name: classification_energetique classification_energetique_idclasse_rendement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classification_energetique
    ADD CONSTRAINT classification_energetique_idclasse_rendement_fkey FOREIGN KEY (idclasse_rendement) REFERENCES sav.classe_rendement(id);


--
-- TOC entry 6205 (class 2606 OID 1511926)
-- Name: classification_energetique classification_energetique_idequipement_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.classification_energetique
    ADD CONSTRAINT classification_energetique_idequipement_type_fkey FOREIGN KEY (idequipement_type) REFERENCES sav.equipement_type(id);


--
-- TOC entry 6211 (class 2606 OID 1511931)
-- Name: client_adresse client_adresse_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_adresse
    ADD CONSTRAINT client_adresse_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6212 (class 2606 OID 1511936)
-- Name: client_adresse client_adresse_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_adresse
    ADD CONSTRAINT client_adresse_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6206 (class 2606 OID 1511941)
-- Name: client client_code_ec_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_code_ec_fkey FOREIGN KEY (idetat_civil) REFERENCES sav.etat_civil(id);


--
-- TOC entry 6213 (class 2606 OID 1511946)
-- Name: client_email client_email_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_email
    ADD CONSTRAINT client_email_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6207 (class 2606 OID 1511951)
-- Name: client client_idcategorie_pro_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_idcategorie_pro_fkey FOREIGN KEY (idcategorie_pro) REFERENCES sav.categorie_pro(id);


--
-- TOC entry 6208 (class 2606 OID 1511956)
-- Name: client client_idclient_tutelle_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_idclient_tutelle_fkey FOREIGN KEY (idclient_tutelle) REFERENCES sav.client(id);


--
-- TOC entry 6209 (class 2606 OID 1511961)
-- Name: client client_idcompte_client_web_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_idcompte_client_web_fkey FOREIGN KEY (idcompte_client_web) REFERENCES sav.compte_client_web(id);


--
-- TOC entry 6210 (class 2606 OID 1511966)
-- Name: client client_idtype_client_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client
    ADD CONSTRAINT client_idtype_client_fkey FOREIGN KEY (idtype_client) REFERENCES sav.type_client(id);


--
-- TOC entry 6214 (class 2606 OID 1511971)
-- Name: client_site client_site_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_site
    ADD CONSTRAINT client_site_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6215 (class 2606 OID 1511976)
-- Name: client_site client_site_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_site
    ADD CONSTRAINT client_site_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6216 (class 2606 OID 1511981)
-- Name: client_tel client_tel_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_tel
    ADD CONSTRAINT client_tel_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6217 (class 2606 OID 1511986)
-- Name: client_tel client_tel_idtype_tel_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.client_tel
    ADD CONSTRAINT client_tel_idtype_tel_fkey FOREIGN KEY (idtype_tel) REFERENCES sav.type_tel(id);


--
-- TOC entry 6218 (class 2606 OID 1511991)
-- Name: code_postal_antennes code_postal_antennes_idsite; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.code_postal_antennes
    ADD CONSTRAINT code_postal_antennes_idsite FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6219 (class 2606 OID 1511996)
-- Name: communication_client communication_client_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6220 (class 2606 OID 1512001)
-- Name: communication_client communication_client_idcommunication_canal_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idcommunication_canal_fkey FOREIGN KEY (idcommunication_canal) REFERENCES sav.communication_canal(id);


--
-- TOC entry 6221 (class 2606 OID 1512006)
-- Name: communication_client communication_client_idcommunication_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idcommunication_type_fkey FOREIGN KEY (idcommunication_type) REFERENCES sav.communication_type(id);


--
-- TOC entry 6222 (class 2606 OID 1512011)
-- Name: communication_client communication_client_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);

--
-- TOC entry 6222 (class 2606 OID 1512011)
-- Name: communication_client communication_client_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6223 (class 2606 OID 1512016)
-- Name: communication_client communication_client_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.communication_client
    ADD CONSTRAINT communication_client_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6225 (class 2606 OID 1512021)
-- Name: contrat contrat_idagent_souscription_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat
    ADD CONSTRAINT contrat_idagent_souscription_fkey FOREIGN KEY (idagent_souscription) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6226 (class 2606 OID 1512026)
-- Name: contrat contrat_idcontrat_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat
    ADD CONSTRAINT contrat_idcontrat_type_fkey FOREIGN KEY (idcontrat_type) REFERENCES sav.contrat_type(id);


--
-- TOC entry 6227 (class 2606 OID 1512031)
-- Name: contrat contrat_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat
    ADD CONSTRAINT contrat_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6228 (class 2606 OID 1512036)
-- Name: contrat contrat_idfacture_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat
    ADD CONSTRAINT contrat_idfacture_fkey FOREIGN KEY (idfacture) REFERENCES sav.facture(id);


--
-- TOC entry 6229 (class 2606 OID 1512041)
-- Name: contrat_proposition contrat_proposition_idcontrat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_proposition
    ADD CONSTRAINT contrat_proposition_idcontrat_fkey FOREIGN KEY (idcontrat) REFERENCES sav.contrat(id);


--
-- TOC entry 6230 (class 2606 OID 1512046)
-- Name: contrat_proposition contrat_proposition_idcontrat_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_proposition
    ADD CONSTRAINT contrat_proposition_idcontrat_type_fkey FOREIGN KEY (idcontrat_type) REFERENCES sav.contrat_type(id);


--
-- TOC entry 6231 (class 2606 OID 1512051)
-- Name: contrat_relance contrat_relance_idcontrat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_relance
    ADD CONSTRAINT contrat_relance_idcontrat_fkey FOREIGN KEY (idcontrat) REFERENCES sav.contrat(id);


--
-- TOC entry 6232 (class 2606 OID 1512056)
-- Name: contrat_resiliation contrat_resiliation_idcontrat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_idcontrat_fkey FOREIGN KEY (idcontrat) REFERENCES sav.contrat(id);


--
-- TOC entry 6233 (class 2606 OID 1512061)
-- Name: contrat_resiliation contrat_resiliation_idcontrat_motif_resiliation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_idcontrat_motif_resiliation_fkey FOREIGN KEY (idcontrat_motif_resiliation) REFERENCES sav.contrat_motif_resiliation(id);


--
-- TOC entry 6234 (class 2606 OID 1512066)
-- Name: contrat_resiliation contrat_resiliation_idequipement_marque_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_idequipement_marque_fkey FOREIGN KEY (idequipement_marque) REFERENCES sav.equipement_marque(id);


--
-- TOC entry 6235 (class 2606 OID 1512071)
-- Name: contrat_resiliation contrat_resiliation_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6236 (class 2606 OID 1512076)
-- Name: contrat_resiliation contrat_resiliation_idtype_envoi_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_resiliation
    ADD CONSTRAINT contrat_resiliation_idtype_envoi_fkey FOREIGN KEY (idtype_envoi) REFERENCES sav.type_envoi(id);


--
-- TOC entry 6237 (class 2606 OID 1512081)
-- Name: contrat_tarif contrat_tarif_idcontrat_plage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_tarif
    ADD CONSTRAINT contrat_tarif_idcontrat_plage_fkey FOREIGN KEY (idcontrat_plage) REFERENCES sav.contrat_plage(id) NOT VALID;


--
-- TOC entry 6238 (class 2606 OID 1512086)
-- Name: contrat_tarif contrat_tarif_idcontrat_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_tarif
    ADD CONSTRAINT contrat_tarif_idcontrat_type_fkey FOREIGN KEY (idcontrat_type) REFERENCES sav.contrat_type(id);


--
-- TOC entry 6239 (class 2606 OID 1512091)
-- Name: contrat_tarif contrat_tarif_idequipement_type_puissance_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_tarif
    ADD CONSTRAINT contrat_tarif_idequipement_type_puissance_fkey FOREIGN KEY (idequipement_type_puissance) REFERENCES sav.equipement_type_puissance(id) NOT VALID;


--
-- TOC entry 6240 (class 2606 OID 1512096)
-- Name: contrat_type contrat_type_idcontrat_regroupement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.contrat_type
    ADD CONSTRAINT contrat_type_idcontrat_regroupement_fkey FOREIGN KEY (idcontrat_regroupement) REFERENCES sav.contrat_regroupement(id) NOT VALID;


--
-- TOC entry 6241 (class 2606 OID 1512101)
-- Name: courrier_client courrier_client_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.courrier_client
    ADD CONSTRAINT courrier_client_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6242 (class 2606 OID 1512106)
-- Name: courrier_client courrier_client_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.courrier_client
    ADD CONSTRAINT courrier_client_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6243 (class 2606 OID 1512111)
-- Name: demande_documentation demande_documentation_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.demande_documentation
    ADD CONSTRAINT demande_documentation_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.type_demandeur(id);


--
-- TOC entry 6244 (class 2606 OID 1512116)
-- Name: demande_documentation demande_documentation_idtype_demandeur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.demande_documentation
    ADD CONSTRAINT demande_documentation_idtype_demandeur_fkey FOREIGN KEY (idtype_demandeur) REFERENCES sav.equipement(id);


--
-- TOC entry 6245 (class 2606 OID 1512121)
-- Name: devis devis_iddevis_statut_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_iddevis_statut_fkey FOREIGN KEY (iddevis_statut) REFERENCES sav.devis_statut(id) NOT VALID;


--
-- TOC entry 6246 (class 2606 OID 1512126)
-- Name: devis devis_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6247 (class 2606 OID 1512131)
-- Name: devis devis_idmag_commande_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_idmag_commande_fkey FOREIGN KEY (idmag_commande) REFERENCES sav.mag_commande(id);


--
-- TOC entry 6250 (class 2606 OID 1512136)
-- Name: devis_ligne devis_idproduit_facture_affectation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne
    ADD CONSTRAINT devis_idproduit_facture_affectation_fkey FOREIGN KEY (idproduit_facture_affectation) REFERENCES sav.produit_facture_affectation(id) NOT VALID;


--
-- TOC entry 6251 (class 2606 OID 1512141)
-- Name: devis_ligne devis_idtaux_tva_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne
    ADD CONSTRAINT devis_idtaux_tva_fkey FOREIGN KEY (idtaux_tva) REFERENCES sav.taux_tva(id) NOT VALID;


--
-- TOC entry 6248 (class 2606 OID 1512146)
-- Name: devis devis_idtype_devise_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_idtype_devise_fkey FOREIGN KEY (idtype_devise) REFERENCES sav.type_devise(id) NOT VALID;


--
-- TOC entry 6249 (class 2606 OID 1512151)
-- Name: devis devis_idtype_envoi_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis
    ADD CONSTRAINT devis_idtype_envoi_fkey FOREIGN KEY (idtype_envoi) REFERENCES sav.type_envoi(id) NOT VALID;


--
-- TOC entry 6252 (class 2606 OID 1512156)
-- Name: devis_ligne devis_ligne_iddevis_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne
    ADD CONSTRAINT devis_ligne_iddevis_fkey FOREIGN KEY (iddevis) REFERENCES sav.devis(id) NOT VALID;


--
-- TOC entry 6253 (class 2606 OID 1512161)
-- Name: devis_ligne devis_ligne_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.devis_ligne
    ADD CONSTRAINT devis_ligne_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id) NOT VALID;


--
-- TOC entry 6254 (class 2606 OID 1512166)
-- Name: droit_portail droit_portail_groupe_droit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.droit_portail
    ADD CONSTRAINT droit_portail_groupe_droit_fkey FOREIGN KEY (idgroupe_droit_portail) REFERENCES sav.groupe_droit_portail(id);


--
-- TOC entry 6255 (class 2606 OID 1512171)
-- Name: energie energie_idtype_energie_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.energie
    ADD CONSTRAINT energie_idtype_energie_fkey FOREIGN KEY (idtype_energie) REFERENCES sav.type_energie(id) NOT VALID;


--
-- TOC entry 6274 (class 2606 OID 1512176)
-- Name: equipement_complement equipement_complement_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_complement
    ADD CONSTRAINT equipement_complement_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6275 (class 2606 OID 1512181)
-- Name: equipement_complement equipement_complement_idequipement_marque_fk; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_complement
    ADD CONSTRAINT equipement_complement_idequipement_marque_fk FOREIGN KEY (idequipement_marque) REFERENCES sav.equipement_marque(id) NOT VALID;


--
-- TOC entry 6276 (class 2606 OID 1512186)
-- Name: equipement_complement equipement_complement_idtype_complement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_complement
    ADD CONSTRAINT equipement_complement_idtype_complement_fkey FOREIGN KEY (idtype_complement) REFERENCES sav.type_complement(id);


--
-- TOC entry 6277 (class 2606 OID 1512191)
-- Name: equipement_groupe equipement_groupe_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_groupe
    ADD CONSTRAINT equipement_groupe_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6278 (class 2606 OID 1512196)
-- Name: equipement_groupe equipement_groupe_idequipement_groupe_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_groupe
    ADD CONSTRAINT equipement_groupe_idequipement_groupe_type_fkey FOREIGN KEY (idequipement_groupe_type) REFERENCES sav.equipement_groupe_type(id);


--
-- TOC entry 6279 (class 2606 OID 1512201)
-- Name: equipement_hauteur equipement_hauteur_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_hauteur
    ADD CONSTRAINT equipement_hauteur_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6256 (class 2606 OID 1512206)
-- Name: equipement equipement_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6257 (class 2606 OID 1512211)
-- Name: equipement equipement_idclient_ancien_souscripteur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idclient_ancien_souscripteur_fkey FOREIGN KEY (idclient_ancien_souscripteur) REFERENCES sav.client(id) NOT VALID;


--
-- TOC entry 6258 (class 2606 OID 1512216)
-- Name: equipement equipement_idclient_souscripteur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idclient_souscripteur_fkey FOREIGN KEY (idclient_souscripteur) REFERENCES sav.client(id);


--
-- TOC entry 6259 (class 2606 OID 1512221)
-- Name: equipement equipement_idclient_utilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idclient_utilisateur_fkey FOREIGN KEY (idclient_utilisateur) REFERENCES sav.client(id) NOT VALID;


--
-- TOC entry 6260 (class 2606 OID 1512226)
-- Name: equipement equipement_idequipement_alimentation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_alimentation_fkey FOREIGN KEY (idequipement_alimentation) REFERENCES sav.equipement_alimentation(id) NOT VALID;


--
-- TOC entry 6261 (class 2606 OID 1512231)
-- Name: equipement equipement_idequipement_ancien_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_ancien_fkey FOREIGN KEY (idequipement_ancien) REFERENCES sav.equipement(id) NOT VALID;


--
-- TOC entry 6262 (class 2606 OID 1512236)
-- Name: equipement equipement_idequipement_famille_contrat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_famille_contrat_fkey FOREIGN KEY (idequipement_famille_contrat) REFERENCES sav.equipement_famille_contrat(id) NOT VALID;


--
-- TOC entry 6263 (class 2606 OID 1512241)
-- Name: equipement equipement_idequipement_famille_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_famille_fkey FOREIGN KEY (idequipement_famille) REFERENCES sav.equipement_famille(id) NOT VALID;


--
-- TOC entry 6264 (class 2606 OID 1512246)
-- Name: equipement equipement_idequipement_fluide_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_fluide_fkey FOREIGN KEY (idequipement_fluide) REFERENCES sav.equipement_fluide(id) NOT VALID;


--
-- TOC entry 6265 (class 2606 OID 1512251)
-- Name: equipement equipement_idequipement_local_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_local_fkey FOREIGN KEY (idequipement_local) REFERENCES sav.equipement_local(id);


--
-- TOC entry 6266 (class 2606 OID 1512256)
-- Name: equipement equipement_idequipement_releve_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_releve_fkey FOREIGN KEY (idequipement_releve) REFERENCES sav.equipement_releve(id) NOT VALID;


--
-- TOC entry 6267 (class 2606 OID 1512261)
-- Name: equipement equipement_idequipement_type_puissance_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idequipement_type_puissance_fkey FOREIGN KEY (idequipement_type_puissance) REFERENCES sav.equipement_type_puissance(id) NOT VALID;


--
-- TOC entry 6268 (class 2606 OID 1512266)
-- Name: equipement equipement_idinstallateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idinstallateur_fkey FOREIGN KEY (idinstallateur) REFERENCES sav.installateur(id);


--
-- TOC entry 6269 (class 2606 OID 1512271)
-- Name: equipement equipement_idnature_gaz_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idnature_gaz_fkey FOREIGN KEY (idenergie) REFERENCES sav.energie(id);


--
-- TOC entry 6270 (class 2606 OID 1512276)
-- Name: equipement equipement_idraccordement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idraccordement_fkey FOREIGN KEY (idraccordement) REFERENCES sav.raccordement(id);


--
-- TOC entry 6271 (class 2606 OID 1512281)
-- Name: equipement equipement_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6272 (class 2606 OID 1512286)
-- Name: equipement equipement_idtaux_tva_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idtaux_tva_fkey FOREIGN KEY (idtaux_tva) REFERENCES sav.taux_tva(id) NOT VALID;


--
-- TOC entry 6273 (class 2606 OID 1512291)
-- Name: equipement equipement_idtranche_equipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement
    ADD CONSTRAINT equipement_idtranche_equipement_fkey FOREIGN KEY (idequipement_tranche) REFERENCES sav.equipement_tranche(id);


--
-- TOC entry 6281 (class 2606 OID 1512296)
-- Name: equipement_installation equipement_installation_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_installation
    ADD CONSTRAINT equipement_installation_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id) NOT VALID;


--
-- TOC entry 6282 (class 2606 OID 1512301)
-- Name: equipement_installation equipement_installation_idprotection_sanitaire_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_installation
    ADD CONSTRAINT equipement_installation_idprotection_sanitaire_fkey FOREIGN KEY (idprotection_sanitaire) REFERENCES sav.protection_sanitaire(id) NOT VALID;


--
-- TOC entry 6283 (class 2606 OID 1512306)
-- Name: equipement_installation equipement_installation_idrobinet_remplissage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_installation
    ADD CONSTRAINT equipement_installation_idrobinet_remplissage_fkey FOREIGN KEY (idrobinet_remplissage) REFERENCES sav.robinet_remplissage(id) NOT VALID;


--
-- TOC entry 6284 (class 2606 OID 1512311)
-- Name: equipement_installation equipement_installation_idtype_installation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_installation
    ADD CONSTRAINT equipement_installation_idtype_installation_fkey FOREIGN KEY (idtype_installation) REFERENCES sav.type_installation(id) NOT VALID;


--
-- TOC entry 6285 (class 2606 OID 1512316)
-- Name: equipement_mesure equipement_mesure_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_mesure
    ADD CONSTRAINT equipement_mesure_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6286 (class 2606 OID 1512321)
-- Name: equipement_mesure equipement_mesure_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_mesure
    ADD CONSTRAINT equipement_mesure_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6287 (class 2606 OID 1512326)
-- Name: equipement_option equipement_option_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_option
    ADD CONSTRAINT equipement_option_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6288 (class 2606 OID 1512331)
-- Name: equipement_option equipement_option_idoption; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_option
    ADD CONSTRAINT equipement_option_idoption FOREIGN KEY (idoption) REFERENCES sav.option(id) NOT VALID;


--
-- TOC entry 6289 (class 2606 OID 1512336)
-- Name: equipement_preferences_planification equipement_preference_id_agent; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_preferences_planification
    ADD CONSTRAINT equipement_preference_id_agent FOREIGN KEY (idagent) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6290 (class 2606 OID 1512341)
-- Name: equipement_preferences_planification equipement_preferences_horaire_passage; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_preferences_planification
    ADD CONSTRAINT equipement_preferences_horaire_passage FOREIGN KEY (idhoraire_passage) REFERENCES sav.horaire_passage(id) NOT VALID;


--
-- TOC entry 6291 (class 2606 OID 1512346)
-- Name: equipement_preferences_planification equipement_preferences_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_preferences_planification
    ADD CONSTRAINT equipement_preferences_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6292 (class 2606 OID 1512351)
-- Name: equipement_type_famille equipement_type_famille_idequipement_famille_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_famille
    ADD CONSTRAINT equipement_type_famille_idequipement_famille_fkey FOREIGN KEY (idequipement_famille) REFERENCES sav.equipement_famille(id);


--
-- TOC entry 6293 (class 2606 OID 1512356)
-- Name: equipement_type_famille equipement_type_famille_idequipement_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_famille
    ADD CONSTRAINT equipement_type_famille_idequipement_type_fkey FOREIGN KEY (idequipement_type) REFERENCES sav.equipement_type(id);


--
-- TOC entry 6294 (class 2606 OID 1512361)
-- Name: equipement_type_option equipement_type_option_idequipement_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_option
    ADD CONSTRAINT equipement_type_option_idequipement_type_fkey FOREIGN KEY (idequipement_type) REFERENCES sav.equipement_type(id);


--
-- TOC entry 6295 (class 2606 OID 1512366)
-- Name: equipement_type_option equipement_type_option_idoption; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_option
    ADD CONSTRAINT equipement_type_option_idoption FOREIGN KEY (idoption) REFERENCES sav.option(id) NOT VALID;


--
-- TOC entry 6296 (class 2606 OID 1512371)
-- Name: equipement_type_puissance equipement_type_puissance_idequipement_puissance_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_puissance
    ADD CONSTRAINT equipement_type_puissance_idequipement_puissance_fkey FOREIGN KEY (idequipement_puissance) REFERENCES sav.equipement_puissance(id);


--
-- TOC entry 6297 (class 2606 OID 1512376)
-- Name: equipement_type_puissance equipement_type_puissance_idequipement_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_type_puissance
    ADD CONSTRAINT equipement_type_puissance_idequipement_type_fkey FOREIGN KEY (idequipement_type) REFERENCES sav.equipement_type(id);


--
-- TOC entry 6298 (class 2606 OID 1512381)
-- Name: equipement_zone equipement_zone_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_zone
    ADD CONSTRAINT equipement_zone_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6299 (class 2606 OID 1512386)
-- Name: equipement_zone equipement_zone_idtype_zone_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_zone
    ADD CONSTRAINT equipement_zone_idtype_zone_fkey FOREIGN KEY (idtype_zone) REFERENCES sav.type_zone(id);


--
-- TOC entry 6308 (class 2606 OID 1512391)
-- Name: facture facture_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6309 (class 2606 OID 1512396)
-- Name: facture facture_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6310 (class 2606 OID 1512401)
-- Name: facture facture_iddevis_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_iddevis_fkey FOREIGN KEY (iddevis) REFERENCES sav.devis(id);


--
-- TOC entry 6311 (class 2606 OID 1512406)
-- Name: facture facture_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6312 (class 2606 OID 1512411)
-- Name: facture facture_idfacture_acompte_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idfacture_acompte_fkey FOREIGN KEY (idfacture_acompte) REFERENCES sav.facture(id) NOT VALID;


--
-- TOC entry 6313 (class 2606 OID 1512416)
-- Name: facture facture_idfacture_categorie_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idfacture_categorie_fkey FOREIGN KEY (idfacture_categorie) REFERENCES sav.facture_categorie(id);


--
-- TOC entry 6314 (class 2606 OID 1512421)
-- Name: facture facture_idfacture_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idfacture_type_fkey FOREIGN KEY (idfacture_type) REFERENCES sav.facture_type(id);


--
-- TOC entry 6315 (class 2606 OID 1512426)
-- Name: facture facture_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6316 (class 2606 OID 1512431)
-- Name: facture facture_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6317 (class 2606 OID 1512436)
-- Name: facture facture_idtype_devise_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture
    ADD CONSTRAINT facture_idtype_devise_fkey FOREIGN KEY (idtype_devise) REFERENCES sav.type_devise(id) NOT VALID;


--
-- TOC entry 6318 (class 2606 OID 1512441)
-- Name: facture_ligne facture_ligne_idfacture_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne
    ADD CONSTRAINT facture_ligne_idfacture_fkey FOREIGN KEY (idfacture) REFERENCES sav.facture(id);


--
-- TOC entry 6319 (class 2606 OID 1512446)
-- Name: facture_ligne facture_ligne_idproduit_facture_affectation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne
    ADD CONSTRAINT facture_ligne_idproduit_facture_affectation_fkey FOREIGN KEY (idproduit_facture_affectation) REFERENCES sav.produit_facture_affectation(id);


--
-- TOC entry 6320 (class 2606 OID 1512451)
-- Name: facture_ligne facture_ligne_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne
    ADD CONSTRAINT facture_ligne_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6321 (class 2606 OID 1512456)
-- Name: facture_ligne facture_ligne_idtaux_tva_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_ligne
    ADD CONSTRAINT facture_ligne_idtaux_tva_fkey FOREIGN KEY (idtaux_tva) REFERENCES sav.taux_tva(id) NOT VALID;


--
-- TOC entry 6322 (class 2606 OID 1512461)
-- Name: facture_relance facture_relance_idfacture_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_relance
    ADD CONSTRAINT facture_relance_idfacture_fkey FOREIGN KEY (idfacture) REFERENCES sav.facture(id);


--
-- TOC entry 6323 (class 2606 OID 1512466)
-- Name: facture_tva facture_tva_idfacture_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_tva
    ADD CONSTRAINT facture_tva_idfacture_fkey FOREIGN KEY (idfacture) REFERENCES sav.facture(id);


--
-- TOC entry 6324 (class 2606 OID 1512471)
-- Name: facture_tva facture_tva_idtaux_tva_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.facture_tva
    ADD CONSTRAINT facture_tva_idtaux_tva_fkey FOREIGN KEY (idtaux_tva) REFERENCES sav.taux_tva(id);


--
-- TOC entry 6347 (class 2606 OID 1512476)
-- Name: horaire_passage fk_horaire_passage_site; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.horaire_passage
    ADD CONSTRAINT fk_horaire_passage_site FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6280 (class 2606 OID 1512481)
-- Name: equipement_hauteur fk_idequipement; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.equipement_hauteur
    ADD CONSTRAINT fk_idequipement FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6414 (class 2606 OID 1512486)
-- Name: planning_agent_exclusion_type_planification fk_planning_agent_exclusion_type_planification_type_planificat; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_agent_exclusion_type_planification
    ADD CONSTRAINT fk_planning_agent_exclusion_type_planification_type_planificat FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6415 (class 2606 OID 1512491)
-- Name: planning_agent_exclusion_type_planification fk_planning_agent_exclusion_type_planification_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_agent_exclusion_type_planification
    ADD CONSTRAINT fk_planning_agent_exclusion_type_planification_utilisateur FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6416 (class 2606 OID 1512496)
-- Name: planning_blocage fk_planning_blocage_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_blocage
    ADD CONSTRAINT fk_planning_blocage_utilisateur FOREIGN KEY (idutilisateur_agent_bloque) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6417 (class 2606 OID 1512501)
-- Name: planning_blocage fk_planning_blocage_utilisateur_0; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_blocage
    ADD CONSTRAINT fk_planning_blocage_utilisateur_0 FOREIGN KEY (idutilisateur_blocage) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6418 (class 2606 OID 1512506)
-- Name: planning_conflit fk_planning_conflit_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_conflit
    ADD CONSTRAINT fk_planning_conflit_planning FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6404 (class 2606 OID 1512511)
-- Name: planning fk_planning_equipement; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_equipement FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6300 (class 2606 OID 1512516)
-- Name: evenement fk_planning_evenement_autre_type_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT fk_planning_evenement_autre_type_planification FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6301 (class 2606 OID 1512521)
-- Name: evenement fk_planning_evenement_formation; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT fk_planning_evenement_formation FOREIGN KEY (idformation) REFERENCES sav.formation(id);


--
-- TOC entry 6307 (class 2606 OID 1512526)
-- Name: evenement_objet fk_planning_evenement_objet_type_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_objet
    ADD CONSTRAINT fk_planning_evenement_objet_type_planification FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6420 (class 2606 OID 1512531)
-- Name: planning_historique_modification fk_planning_historique_modification_horaire_passage; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_horaire_passage FOREIGN KEY (idhoraire_passage) REFERENCES sav.horaire_passage(id);


--
-- TOC entry 6421 (class 2606 OID 1512536)
-- Name: planning_historique_modification fk_planning_historique_modification_moment_passage; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_moment_passage FOREIGN KEY (idmoment_passage) REFERENCES sav.moment_passage(id);


--
-- TOC entry 6422 (class 2606 OID 1512541)
-- Name: planning_historique_modification fk_planning_historique_modification_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_planning FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6423 (class 2606 OID 1512546)
-- Name: planning_historique_modification fk_planning_historique_modification_planning_action; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_planning_action FOREIGN KEY (idplanning_action) REFERENCES sav.planning_action(id);


--
-- TOC entry 6424 (class 2606 OID 1512551)
-- Name: planning_historique_modification fk_planning_historique_modification_planning_initiative; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_planning_initiative FOREIGN KEY (idplanning_initiative_detail) REFERENCES sav.planning_initiative_detail(id);


--
-- TOC entry 6425 (class 2606 OID 1512556)
-- Name: planning_historique_modification fk_planning_historique_modification_planning_initiative_type; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_planning_initiative_type FOREIGN KEY (idplanning_initiative_type) REFERENCES sav.planning_initiative_type(id);


--
-- TOC entry 6426 (class 2606 OID 1512561)
-- Name: planning_historique_modification fk_planning_historique_modification_type_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_type_planification FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6427 (class 2606 OID 1512566)
-- Name: planning_historique_modification fk_planning_historique_modification_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_utilisateur FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6428 (class 2606 OID 1512571)
-- Name: planning_historique_modification fk_planning_historique_modification_utilisateur_0; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_utilisateur_0 FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6429 (class 2606 OID 1512576)
-- Name: planning_historique_modification fk_planning_historique_modification_utilisateur_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT fk_planning_historique_modification_utilisateur_planning FOREIGN KEY (idutilisateur_planning) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6405 (class 2606 OID 1512581)
-- Name: planning fk_planning_horaire_passage; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_horaire_passage FOREIGN KEY (idhoraire_passage) REFERENCES sav.horaire_passage(id);


--
-- TOC entry 6436 (class 2606 OID 1512586)
-- Name: planning_initiative_detail fk_planning_initiative_planning_initiative_type; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_initiative_detail
    ADD CONSTRAINT fk_planning_initiative_planning_initiative_type FOREIGN KEY (idplanning_initiative_type) REFERENCES sav.planning_initiative_type(id);


--
-- TOC entry 6305 (class 2606 OID 1512591)
-- Name: evenement_lieu_type_planification fk_planning_lieu_type_evenement_planning_lieu; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_lieu_type_planification
    ADD CONSTRAINT fk_planning_lieu_type_evenement_planning_lieu FOREIGN KEY (idevenement_lieu) REFERENCES sav.evenement_lieu(id);


--
-- TOC entry 6306 (class 2606 OID 1512596)
-- Name: evenement_lieu_type_planification fk_planning_lieu_type_planification_type_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement_lieu_type_planification
    ADD CONSTRAINT fk_planning_lieu_type_planification_type_planification FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6406 (class 2606 OID 1512601)
-- Name: planning fk_planning_moment_passage; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_moment_passage FOREIGN KEY (idmoment_passage) REFERENCES sav.moment_passage(id);


--
-- TOC entry 6407 (class 2606 OID 1512606)
-- Name: planning fk_planning_planning_initiative_detail; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_planning_initiative_detail FOREIGN KEY (idplanning_initiative_detail) REFERENCES sav.planning_initiative_detail(id);


--
-- TOC entry 6408 (class 2606 OID 1512611)
-- Name: planning fk_planning_planning_initiative_type; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_planning_initiative_type FOREIGN KEY (idplanning_initiative_type) REFERENCES sav.planning_initiative_type(id);


--
-- TOC entry 6302 (class 2606 OID 1512616)
-- Name: evenement fk_planning_reunion_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT fk_planning_reunion_planning FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6303 (class 2606 OID 1512621)
-- Name: evenement fk_planning_reunion_planning_evenement; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT fk_planning_reunion_planning_evenement FOREIGN KEY (idevenement_objet) REFERENCES sav.evenement_objet(id);


--
-- TOC entry 6304 (class 2606 OID 1512626)
-- Name: evenement fk_planning_reunion_planning_lieu; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.evenement
    ADD CONSTRAINT fk_planning_reunion_planning_lieu FOREIGN KEY (idevenement_lieu) REFERENCES sav.evenement_lieu(id);


--
-- TOC entry 6409 (class 2606 OID 1512631)
-- Name: planning fk_planning_site; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_site FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6438 (class 2606 OID 1512636)
-- Name: planning_transit fk_planning_transit_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_transit
    ADD CONSTRAINT fk_planning_transit_planning FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6439 (class 2606 OID 1512641)
-- Name: planning_transit fk_planning_transit_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_transit
    ADD CONSTRAINT fk_planning_transit_utilisateur FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6410 (class 2606 OID 1512646)
-- Name: planning fk_planning_type_duree; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_type_duree FOREIGN KEY (idtype_duree) REFERENCES sav.type_duree(id);


--
-- TOC entry 6411 (class 2606 OID 1512651)
-- Name: planning fk_planning_type_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_type_planification FOREIGN KEY (idtype_planification_init) REFERENCES sav.type_planification(id);


--
-- TOC entry 6412 (class 2606 OID 1512656)
-- Name: planning fk_planning_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_utilisateur FOREIGN KEY (idutilisateur_agent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6413 (class 2606 OID 1512661)
-- Name: planning fk_planning_utilisateur_planning; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning
    ADD CONSTRAINT fk_planning_utilisateur_planning FOREIGN KEY (idutilisateur_planning) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6480 (class 2606 OID 1512666)
-- Name: type_planification fk_type_planification_categorie_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification
    ADD CONSTRAINT fk_type_planification_categorie_planification FOREIGN KEY (idcategorie_planification) REFERENCES sav.categorie_planification(id);


--
-- TOC entry 6481 (class 2606 OID 1512671)
-- Name: type_planification fk_type_planification_type_duree; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification
    ADD CONSTRAINT fk_type_planification_type_duree FOREIGN KEY (idtype_duree) REFERENCES sav.type_duree(id);


--
-- TOC entry 6473 (class 2606 OID 1512676)
-- Name: tchat_message groupe_idgroupe_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tchat_message
    ADD CONSTRAINT groupe_idgroupe_fkey FOREIGN KEY (idgroupe) REFERENCES sav.groupe(id);


--
-- TOC entry 6325 (class 2606 OID 1512681)
-- Name: groupe groupe_idgroupe_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe
    ADD CONSTRAINT groupe_idgroupe_type_fkey FOREIGN KEY (idgroupe_type) REFERENCES sav.groupe_type(id);


--
-- TOC entry 6326 (class 2606 OID 1512686)
-- Name: groupe groupe_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe
    ADD CONSTRAINT groupe_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6327 (class 2606 OID 1512691)
-- Name: groupe groupe_idutilisateur_admin_groupe_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe
    ADD CONSTRAINT groupe_idutilisateur_admin_groupe_fkey FOREIGN KEY (idutilisateur_admin_groupe) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6474 (class 2606 OID 1512696)
-- Name: tchat_message groupe_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tchat_message
    ADD CONSTRAINT groupe_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6328 (class 2606 OID 1512701)
-- Name: groupe_utilisateur groupe_utilisateur_iddernier_message_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_utilisateur
    ADD CONSTRAINT groupe_utilisateur_iddernier_message_fkey FOREIGN KEY (iddernier_message_lu) REFERENCES sav.tchat_message(id) NOT VALID;


--
-- TOC entry 6329 (class 2606 OID 1512706)
-- Name: groupe_utilisateur groupe_utilisateur_idgroupe_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_utilisateur
    ADD CONSTRAINT groupe_utilisateur_idgroupe_fkey FOREIGN KEY (idgroupe) REFERENCES sav.groupe(id);


--
-- TOC entry 6330 (class 2606 OID 1512711)
-- Name: groupe_utilisateur groupe_utilisateur_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.groupe_utilisateur
    ADD CONSTRAINT groupe_utilisateur_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6331 (class 2606 OID 1512716)
-- Name: historique_client_equipement historique_client_equipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement
    ADD CONSTRAINT historique_client_equipement_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6332 (class 2606 OID 1512721)
-- Name: historique_client_equipement historique_client_equipement_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement
    ADD CONSTRAINT historique_client_equipement_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6333 (class 2606 OID 1512726)
-- Name: historique_client_equipement historique_client_equipement_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement
    ADD CONSTRAINT historique_client_equipement_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6334 (class 2606 OID 1512731)
-- Name: historique_client_equipement historique_client_equipement_idsouscripteur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_client_equipement
    ADD CONSTRAINT historique_client_equipement_idsouscripteur_fkey FOREIGN KEY (idsouscripteur) REFERENCES sav.client(id);


--
-- TOC entry 6335 (class 2606 OID 1512736)
-- Name: historique_equipement_local historique_equipement_local_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_local
    ADD CONSTRAINT historique_equipement_local_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6336 (class 2606 OID 1512741)
-- Name: historique_equipement_local historique_equipement_local_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_local
    ADD CONSTRAINT historique_equipement_local_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6337 (class 2606 OID 1512746)
-- Name: historique_equipement_local historique_equipement_local_idequipement_local_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_local
    ADD CONSTRAINT historique_equipement_local_idequipement_local_fkey FOREIGN KEY (idequipement_local) REFERENCES sav.equipement_local(id);


--
-- TOC entry 6338 (class 2606 OID 1512751)
-- Name: historique_equipement_utilisateur historique_equipement_utilisateur; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_utilisateur
    ADD CONSTRAINT historique_equipement_utilisateur FOREIGN KEY (idutilisateur) REFERENCES sav.client(id) NOT VALID;


--
-- TOC entry 6339 (class 2606 OID 1512756)
-- Name: historique_equipement_utilisateur historique_equipement_utilisateur_equipement; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_utilisateur
    ADD CONSTRAINT historique_equipement_utilisateur_equipement FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6340 (class 2606 OID 1512761)
-- Name: historique_equipement_utilisateur historique_equipement_utilisateur_modif; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_equipement_utilisateur
    ADD CONSTRAINT historique_equipement_utilisateur_modif FOREIGN KEY (idutilisateur_modif) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6341 (class 2606 OID 1512766)
-- Name: historique_modification historique_modification_idagent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idagent_fkey FOREIGN KEY (idagent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6342 (class 2606 OID 1512771)
-- Name: historique_modification historique_modification_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6343 (class 2606 OID 1512776)
-- Name: historique_modification historique_modification_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6344 (class 2606 OID 1512781)
-- Name: historique_modification historique_modification_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6345 (class 2606 OID 1512786)
-- Name: historique_modification historique_modification_idutilisateur_modif_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idutilisateur_modif_fkey FOREIGN KEY (idutilisateur_modif) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6346 (class 2606 OID 1512791)
-- Name: historique_modification historique_modification_idutilisateur_valide_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.historique_modification
    ADD CONSTRAINT historique_modification_idutilisateur_valide_fkey FOREIGN KEY (idutilisateur_valide) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6348 (class 2606 OID 1512796)
-- Name: horaire_passage horaire_passage_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.horaire_passage
    ADD CONSTRAINT horaire_passage_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6364 (class 2606 OID 1512801)
-- Name: intervention_annulation intervention_annulation_idintervention_motif_abandon_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_annulation
    ADD CONSTRAINT intervention_annulation_idintervention_motif_abandon_fkey FOREIGN KEY (idintervention_motif_abandon) REFERENCES sav.intervention_motif_abandon(id);


--
-- TOC entry 6365 (class 2606 OID 1512806)
-- Name: intervention_annulation intervention_annulation_idintervention_motif_absence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_annulation
    ADD CONSTRAINT intervention_annulation_idintervention_motif_absence_fkey FOREIGN KEY (idintervention_motif_absence) REFERENCES sav.intervention_motif_absence(id);


--
-- TOC entry 6366 (class 2606 OID 1512811)
-- Name: intervention_annulation intervention_annulation_idintervention_motif_annulation_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_annulation
    ADD CONSTRAINT intervention_annulation_idintervention_motif_annulation_fkey FOREIGN KEY (idintervention_motif_annulation) REFERENCES sav.intervention_motif_annulation(id);


--
-- TOC entry 6367 (class 2606 OID 1512816)
-- Name: intervention_anomalie intervention_anomalie_idanomalie_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_anomalie
    ADD CONSTRAINT intervention_anomalie_idanomalie_fkey FOREIGN KEY (idanomalie) REFERENCES sav.anomalie(id);


--
-- TOC entry 6368 (class 2606 OID 1512821)
-- Name: intervention_anomalie intervention_anomalie_idanomalie_oracle_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_anomalie
    ADD CONSTRAINT intervention_anomalie_idanomalie_oracle_fkey FOREIGN KEY (idanomalie_oracle) REFERENCES sav.anomalie_oracle(id);


--
-- TOC entry 6369 (class 2606 OID 1512826)
-- Name: intervention_anomalie intervention_anomalie_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_anomalie
    ADD CONSTRAINT intervention_anomalie_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6370 (class 2606 OID 1512831)
-- Name: intervention_document intervention_document_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_document
    ADD CONSTRAINT intervention_document_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6349 (class 2606 OID 1512836)
-- Name: intervention intervention_idattestation_entretien_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idattestation_entretien_fkey FOREIGN KEY (idattestation_entretien) REFERENCES sav.attestation_entretien(id) NOT VALID;


--
-- TOC entry 6350 (class 2606 OID 1512841)
-- Name: intervention intervention_idclient_payeur_tiers_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idclient_payeur_tiers_fkey FOREIGN KEY (idclient_payeur_tiers) REFERENCES sav.client(id);


--
-- TOC entry 6351 (class 2606 OID 1512846)
-- Name: intervention intervention_idcontrat_tarif_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idcontrat_tarif_fkey FOREIGN KEY (idcontrat_tarif) REFERENCES sav.contrat_tarif(id);


--
-- TOC entry 6352 (class 2606 OID 1512851)
-- Name: intervention intervention_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6353 (class 2606 OID 1512856)
-- Name: intervention intervention_idintervention_motif_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idintervention_motif_fkey FOREIGN KEY (idintervention_motif) REFERENCES sav.intervention_motif(id);


--
-- TOC entry 6354 (class 2606 OID 1512861)
-- Name: intervention intervention_idplanning_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idplanning_fkey FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6355 (class 2606 OID 1512866)
-- Name: intervention intervention_idretour_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idretour_fkey FOREIGN KEY (idretour) REFERENCES sav.retour(id) NOT VALID;


--
-- TOC entry 6356 (class 2606 OID 1512871)
-- Name: intervention intervention_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6357 (class 2606 OID 1512876)
-- Name: intervention intervention_idtype_envoi_rapport_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idtype_envoi_rapport_fkey FOREIGN KEY (idtype_envoi_rapport) REFERENCES sav.type_envoi(id);


--
-- TOC entry 6358 (class 2606 OID 1512881)
-- Name: intervention intervention_idtype_planification_init_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idtype_planification_init_fkey FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6359 (class 2606 OID 1512886)
-- Name: intervention intervention_idtype_validation_adm_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idtype_validation_adm_fkey FOREIGN KEY (idtype_validation_adm) REFERENCES sav.intervention_type_validation(id) NOT VALID;


--
-- TOC entry 6360 (class 2606 OID 1512891)
-- Name: intervention intervention_idtype_validation_technique_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idtype_validation_technique_fkey FOREIGN KEY (idtype_validation_technique) REFERENCES sav.intervention_type_validation(id) NOT VALID;


--
-- TOC entry 6361 (class 2606 OID 1512896)
-- Name: intervention intervention_idtype_visite_intervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idtype_visite_intervention_fkey FOREIGN KEY (idtype_visite_intervention) REFERENCES sav.type_visite_intervention(id) NOT VALID;


--
-- TOC entry 6362 (class 2606 OID 1512901)
-- Name: intervention intervention_idutilisateur_validation_adm_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idutilisateur_validation_adm_fkey FOREIGN KEY (idutilisateur_validation_adm) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6363 (class 2606 OID 1512906)
-- Name: intervention intervention_idutilisateur_validation_technique_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention
    ADD CONSTRAINT intervention_idutilisateur_validation_technique_fkey FOREIGN KEY (idutilisateur_validation_technique) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6371 (class 2606 OID 1512911)
-- Name: intervention_media intervention_media_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_media
    ADD CONSTRAINT intervention_media_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6372 (class 2606 OID 1512916)
-- Name: intervention_mesure intervention_mesure_idintervention; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_mesure
    ADD CONSTRAINT intervention_mesure_idintervention FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6373 (class 2606 OID 1512921)
-- Name: intervention_mesure intervention_mesure_idtype_mesure; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_mesure
    ADD CONSTRAINT intervention_mesure_idtype_mesure FOREIGN KEY (idtype_mesure) REFERENCES sav.type_mesure(id);


--
-- TOC entry 6374 (class 2606 OID 1512926)
-- Name: intervention_pre_encaissement intervention_pre_encaissement_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement
    ADD CONSTRAINT intervention_pre_encaissement_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6375 (class 2606 OID 1512931)
-- Name: intervention_pre_encaissement intervention_pre_encaissement_idmoyen_paiement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement
    ADD CONSTRAINT intervention_pre_encaissement_idmoyen_paiement_fkey FOREIGN KEY (idmoyen_paiement) REFERENCES sav.moyen_paiement(id);


--
-- TOC entry 6376 (class 2606 OID 1512936)
-- Name: intervention_pre_encaissement intervention_pre_encaissement_idutilisateur_reception; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement
    ADD CONSTRAINT intervention_pre_encaissement_idutilisateur_reception FOREIGN KEY (idutilisateur_reception) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6377 (class 2606 OID 1512941)
-- Name: intervention_pre_encaissement intervention_pre_encaissement_idutilisateur_responsable; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_pre_encaissement
    ADD CONSTRAINT intervention_pre_encaissement_idutilisateur_responsable FOREIGN KEY (idutilisateur_responsable) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6378 (class 2606 OID 1512946)
-- Name: intervention_stack intervention_retour_idagent_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.intervention_stack
    ADD CONSTRAINT intervention_retour_idagent_fkey FOREIGN KEY (idagent) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6379 (class 2606 OID 1512951)
-- Name: lock_entites lock_entites_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.lock_entites
    ADD CONSTRAINT lock_entites_idutilisateur_fkey FOREIGN KEY (id_utilisateur) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6388 (class 2606 OID 1512956)
-- Name: mag_commande_histo mag_commande_histo_idcommande_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande_histo
    ADD CONSTRAINT mag_commande_histo_idcommande_fkey FOREIGN KEY (idmag_commande) REFERENCES sav.mag_commande(id);


--
-- TOC entry 6389 (class 2606 OID 1512961)
-- Name: mag_commande_histo mag_commande_histo_idmag_etat_commande_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande_histo
    ADD CONSTRAINT mag_commande_histo_idmag_etat_commande_fkey FOREIGN KEY (idmag_etat_commande) REFERENCES sav.mag_etat_commande(id);


--
-- TOC entry 6390 (class 2606 OID 1512966)
-- Name: mag_commande_histo mag_commande_histo_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande_histo
    ADD CONSTRAINT mag_commande_histo_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6380 (class 2606 OID 1512971)
-- Name: mag_commande mag_commande_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6381 (class 2606 OID 1512976)
-- Name: mag_commande mag_commande_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6382 (class 2606 OID 1512981)
-- Name: mag_commande mag_commande_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6383 (class 2606 OID 1512986)
-- Name: mag_commande mag_commande_idmag_etat_commande_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idmag_etat_commande_fkey FOREIGN KEY (idmag_etat_commande) REFERENCES sav.mag_etat_commande(id);


--
-- TOC entry 6384 (class 2606 OID 1512991)
-- Name: mag_commande mag_commande_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6385 (class 2606 OID 1512996)
-- Name: mag_commande mag_commande_idsite_livraison_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idsite_livraison_fkey FOREIGN KEY (idsite_livraison) REFERENCES sav.site(id);


--
-- TOC entry 6386 (class 2606 OID 1513001)
-- Name: mag_commande mag_commande_idtype_cde_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idtype_cde_fkey FOREIGN KEY (idtype_cde) REFERENCES sav.mag_type_commande(id);


--
-- TOC entry 6387 (class 2606 OID 1513006)
-- Name: mag_commande mag_commande_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_commande
    ADD CONSTRAINT mag_commande_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6391 (class 2606 OID 1513011)
-- Name: mag_jour_exclusion_livraison mag_jour_exclusion_livraison_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_jour_exclusion_livraison
    ADD CONSTRAINT mag_jour_exclusion_livraison_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6392 (class 2606 OID 1513016)
-- Name: mag_ligne_commande mag_ligne_commande_idmag_commande_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_ligne_commande
    ADD CONSTRAINT mag_ligne_commande_idmag_commande_fkey FOREIGN KEY (idmag_commande) REFERENCES sav.mag_commande(id);


--
-- TOC entry 6393 (class 2606 OID 1513021)
-- Name: mag_ligne_commande mag_ligne_commande_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_ligne_commande
    ADD CONSTRAINT mag_ligne_commande_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6394 (class 2606 OID 1513026)
-- Name: mag_stock_mouvement mag_stock_mouvement_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_stock_mouvement
    ADD CONSTRAINT mag_stock_mouvement_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6395 (class 2606 OID 1513031)
-- Name: mag_stock_mouvement mag_stock_mouvement_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_stock_mouvement
    ADD CONSTRAINT mag_stock_mouvement_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6396 (class 2606 OID 1513036)
-- Name: mag_stock_mouvement mag_stock_mouvement_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.mag_stock_mouvement
    ADD CONSTRAINT mag_stock_mouvement_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6397 (class 2606 OID 1513041)
-- Name: old_bloc_note_client old_bloc_note_client_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.old_bloc_note_client
    ADD CONSTRAINT old_bloc_note_client_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6398 (class 2606 OID 1513046)
-- Name: option_tarif option_tarif_idcontrat_plage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif
    ADD CONSTRAINT option_tarif_idcontrat_plage_fkey FOREIGN KEY (idcontrat_plage) REFERENCES sav.contrat_plage(id) NOT VALID;


--
-- TOC entry 6399 (class 2606 OID 1513051)
-- Name: option_tarif option_tarif_idcontrat_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif
    ADD CONSTRAINT option_tarif_idcontrat_type_fkey FOREIGN KEY (idcontrat_type) REFERENCES sav.contrat_type(id) NOT VALID;


--
-- TOC entry 6400 (class 2606 OID 1513056)
-- Name: option_tarif option_tarif_idequipement_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif
    ADD CONSTRAINT option_tarif_idequipement_type_fkey FOREIGN KEY (idequipement_type) REFERENCES sav.equipement_type(id) NOT VALID;


--
-- TOC entry 6401 (class 2606 OID 1513061)
-- Name: option_tarif option_tarif_idoption_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.option_tarif
    ADD CONSTRAINT option_tarif_idoption_fkey FOREIGN KEY (idoption) REFERENCES sav.option(id);


--
-- TOC entry 6402 (class 2606 OID 1513066)
-- Name: paiement paiement_idfacture_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.paiement
    ADD CONSTRAINT paiement_idfacture_fkey FOREIGN KEY (idfacture) REFERENCES sav.facture(id);


--
-- TOC entry 6403 (class 2606 OID 1513071)
-- Name: paiement paiement_idmoyen_paiement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.paiement
    ADD CONSTRAINT paiement_idmoyen_paiement_fkey FOREIGN KEY (idmoyen_paiement) REFERENCES sav.moyen_paiement(id);


--
-- TOC entry 6419 (class 2606 OID 1513076)
-- Name: planning_conflit planning_conflit_idplanning_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_conflit
    ADD CONSTRAINT planning_conflit_idplanning_fkey FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6430 (class 2606 OID 1513081)
-- Name: planning_historique_modification planning_historique_modification_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6431 (class 2606 OID 1513086)
-- Name: planning_historique_modification planning_historique_modification_idhoraire_passage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idhoraire_passage_fkey FOREIGN KEY (idhoraire_passage) REFERENCES sav.horaire_passage(id);


--
-- TOC entry 6432 (class 2606 OID 1513091)
-- Name: planning_historique_modification planning_historique_modification_idmoment_passage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idmoment_passage_fkey FOREIGN KEY (idmoment_passage) REFERENCES sav.moment_passage(id);


--
-- TOC entry 6433 (class 2606 OID 1513096)
-- Name: planning_historique_modification planning_historique_modification_idplanning_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idplanning_fkey FOREIGN KEY (idplanning) REFERENCES sav.planning(id);


--
-- TOC entry 6434 (class 2606 OID 1513101)
-- Name: planning_historique_modification planning_historique_modification_idtype_planification; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idtype_planification FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id) NOT VALID;


--
-- TOC entry 6435 (class 2606 OID 1513106)
-- Name: planning_historique_modification planning_historique_modification_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_historique_modification
    ADD CONSTRAINT planning_historique_modification_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6437 (class 2606 OID 1513111)
-- Name: planning_initiative_detail planning_initiative_detail_idplanning_initiative_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.planning_initiative_detail
    ADD CONSTRAINT planning_initiative_detail_idplanning_initiative_type_fkey FOREIGN KEY (idplanning_initiative_type) REFERENCES sav.planning_initiative_type(id);


--
-- TOC entry 6440 (class 2606 OID 1513116)
-- Name: porte_ouverte porte_ouverte_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.porte_ouverte
    ADD CONSTRAINT porte_ouverte_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6441 (class 2606 OID 1513121)
-- Name: porte_ouverte porte_ouverte_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.porte_ouverte
    ADD CONSTRAINT porte_ouverte_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id);


--
-- TOC entry 6202 (class 2606 OID 1513126)
-- Name: cgv porte_ouverte_idequipement_famille_contrat_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.cgv
    ADD CONSTRAINT porte_ouverte_idequipement_famille_contrat_fkey FOREIGN KEY (idequipement_famille_contrat) REFERENCES sav.equipement_famille_contrat(id);


--
-- TOC entry 6224 (class 2606 OID 1513131)
-- Name: conseil porte_ouverte_idtype_conseil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.conseil
    ADD CONSTRAINT porte_ouverte_idtype_conseil_fkey FOREIGN KEY (idtype_conseil) REFERENCES sav.type_conseil(id);


--
-- TOC entry 6442 (class 2606 OID 1513136)
-- Name: privilege privilege_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6443 (class 2606 OID 1513141)
-- Name: privilege privilege_idintervention_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);


--
-- TOC entry 6444 (class 2606 OID 1513146)
-- Name: privilege privilege_idraison_refus_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_idraison_refus_fkey FOREIGN KEY (idraison_refus) REFERENCES sav.privilege_raison_refus(id);


--
-- TOC entry 6445 (class 2606 OID 1513151)
-- Name: privilege privilege_statut_privilege_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.privilege
    ADD CONSTRAINT privilege_statut_privilege_fkey FOREIGN KEY (idprivilege_statut) REFERENCES sav.privilege_statut(id);


--
-- TOC entry 6449 (class 2606 OID 1513156)
-- Name: produit_famille produit_famille_idfamille_agi_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_famille
    ADD CONSTRAINT produit_famille_idfamille_agi_fkey FOREIGN KEY (idfamille_agi) REFERENCES sav.famille_agi(id) NOT VALID;


--
-- TOC entry 6450 (class 2606 OID 1513161)
-- Name: produit_famille produit_famille_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_famille
    ADD CONSTRAINT produit_famille_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6446 (class 2606 OID 1513166)
-- Name: produit produit_idfamille_agi_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit
    ADD CONSTRAINT produit_idfamille_agi_fkey FOREIGN KEY (idfamille_agi) REFERENCES sav.famille_agi(id) NOT VALID;


--
-- TOC entry 6447 (class 2606 OID 1513171)
-- Name: produit produit_idproduit_type_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit
    ADD CONSTRAINT produit_idproduit_type_fkey FOREIGN KEY (idproduit_type) REFERENCES sav.produit_type(id);


--
-- TOC entry 6448 (class 2606 OID 1513176)
-- Name: produit produit_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit
    ADD CONSTRAINT produit_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6451 (class 2606 OID 1513181)
-- Name: produit_photo produit_photo_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_photo
    ADD CONSTRAINT produit_photo_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6452 (class 2606 OID 1513186)
-- Name: produit_prestation_tarif produit_prestation_tarif_idcontrat_plage_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_prestation_tarif
    ADD CONSTRAINT produit_prestation_tarif_idcontrat_plage_fkey FOREIGN KEY (idcontrat_plage) REFERENCES sav.contrat_plage(id) NOT VALID;


--
-- TOC entry 6453 (class 2606 OID 1513191)
-- Name: produit_prestation_tarif produit_prestation_tarif_idcontrat_regroupement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_prestation_tarif
    ADD CONSTRAINT produit_prestation_tarif_idcontrat_regroupement_fkey FOREIGN KEY (idcontrat_regroupement) REFERENCES sav.contrat_regroupement(id) NOT VALID;


--
-- TOC entry 6454 (class 2606 OID 1513196)
-- Name: produit_prestation_tarif produit_prestation_tarif_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_prestation_tarif
    ADD CONSTRAINT produit_prestation_tarif_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6455 (class 2606 OID 1513201)
-- Name: produit_stock_site produit_stock_site_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_stock_site
    ADD CONSTRAINT produit_stock_site_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6456 (class 2606 OID 1513206)
-- Name: produit_stock_site produit_stock_site_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.produit_stock_site
    ADD CONSTRAINT produit_stock_site_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6457 (class 2606 OID 1513211)
-- Name: retour retour_idtype_retour_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.retour
    ADD CONSTRAINT retour_idtype_retour_fkey FOREIGN KEY (idtype_retour) REFERENCES sav.type_retour(id);


--
-- TOC entry 6463 (class 2606 OID 1513216)
-- Name: secteur_equipement secteur_equipement_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_equipement
    ADD CONSTRAINT secteur_equipement_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id);


--
-- TOC entry 6464 (class 2606 OID 1513221)
-- Name: secteur_equipement secteur_equipement_idsecteur_version_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_equipement
    ADD CONSTRAINT secteur_equipement_idsecteur_version_fkey FOREIGN KEY (idsecteur) REFERENCES sav.secteur(id);


--
-- TOC entry 6458 (class 2606 OID 1513226)
-- Name: secteur secteur_idsecteur_activite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_idsecteur_activite_fkey FOREIGN KEY (idsecteur_activite) REFERENCES sav.secteur_activite(id);


--
-- TOC entry 6459 (class 2606 OID 1513231)
-- Name: secteur secteur_idsecteur_taux_retour_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_idsecteur_taux_retour_fkey FOREIGN KEY (idsecteur_taux_retour) REFERENCES sav.secteur_taux_retour(id);


--
-- TOC entry 6460 (class 2606 OID 1513236)
-- Name: secteur secteur_idsecteur_zone_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_idsecteur_zone_fkey FOREIGN KEY (idsecteur_zone) REFERENCES sav.secteur_zone(id) NOT VALID;


--
-- TOC entry 6461 (class 2606 OID 1513241)
-- Name: secteur secteur_idsectorisation_version_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_idsectorisation_version_fkey FOREIGN KEY (idsectorisation_version) REFERENCES sav.sectorisation_version(id);


--
-- TOC entry 6462 (class 2606 OID 1513246)
-- Name: secteur secteur_idutilisateur_planning_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur
    ADD CONSTRAINT secteur_idutilisateur_planning_fkey FOREIGN KEY (idutilisateur_planning) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6465 (class 2606 OID 1513251)
-- Name: secteur_tarif secteur_tarif_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_tarif
    ADD CONSTRAINT secteur_tarif_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id) NOT VALID;


--
-- TOC entry 6466 (class 2606 OID 1513256)
-- Name: secteur_tarif secteur_tarif_idsecteur_zone_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.secteur_tarif
    ADD CONSTRAINT secteur_tarif_idsecteur_zone_fkey FOREIGN KEY (idsecteur_zone) REFERENCES sav.secteur_zone(id) NOT VALID;


--
-- TOC entry 6467 (class 2606 OID 1513261)
-- Name: sectorisation_version sectorisation_version_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.sectorisation_version
    ADD CONSTRAINT sectorisation_version_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6468 (class 2606 OID 1513266)
-- Name: sectorisation_version sectorisation_version_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.sectorisation_version
    ADD CONSTRAINT sectorisation_version_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6469 (class 2606 OID 1513271)
-- Name: stock_standard stock_standard_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard
    ADD CONSTRAINT stock_standard_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6470 (class 2606 OID 1513276)
-- Name: stock_standard_produit stock_standard_produit_idproduit_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard_produit
    ADD CONSTRAINT stock_standard_produit_idproduit_fkey FOREIGN KEY (idproduit) REFERENCES sav.produit(id);


--
-- TOC entry 6471 (class 2606 OID 1513281)
-- Name: stock_standard_produit stock_standard_produit_idstock_standard_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.stock_standard_produit
    ADD CONSTRAINT stock_standard_produit_idstock_standard_fkey FOREIGN KEY (idstock_standard) REFERENCES sav.stock_standard(id);


--
-- TOC entry 6472 (class 2606 OID 1513286)
-- Name: taux_tva taux_id_ancien_taux; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.taux_tva
    ADD CONSTRAINT taux_id_ancien_taux FOREIGN KEY (id_ancien_taux_tva) REFERENCES sav.taux_tva(id) NOT VALID;


--
-- TOC entry 6476 (class 2606 OID 1513291)
-- Name: tmp_correspondance_agent tmp_correspondance_agent_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_agent
    ADD CONSTRAINT tmp_correspondance_agent_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id) NOT VALID;


--
-- TOC entry 6477 (class 2606 OID 1513296)
-- Name: tmp_correspondance_equipement tmp_correspondance_equipement_idclient_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_equipement
    ADD CONSTRAINT tmp_correspondance_equipement_idclient_fkey FOREIGN KEY (idclient) REFERENCES sav.client(id) NOT VALID;


--
-- TOC entry 6478 (class 2606 OID 1513301)
-- Name: tmp_correspondance_equipement tmp_correspondance_equipement_idequipement_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_equipement
    ADD CONSTRAINT tmp_correspondance_equipement_idequipement_fkey FOREIGN KEY (idequipement) REFERENCES sav.equipement(id) NOT VALID;


--
-- TOC entry 6479 (class 2606 OID 1513306)
-- Name: tmp_correspondance_equipement tmp_correspondance_equipement_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.tmp_correspondance_equipement
    ADD CONSTRAINT tmp_correspondance_equipement_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6482 (class 2606 OID 1513311)
-- Name: type_planification_type_appareil type_planification_type_appareil_idtype_appareil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification_type_appareil
    ADD CONSTRAINT type_planification_type_appareil_idtype_appareil_fkey FOREIGN KEY (idtype_appareil) REFERENCES sav.type_appareil(id);


--
-- TOC entry 6483 (class 2606 OID 1513316)
-- Name: type_planification_type_appareil type_planification_type_appareil_idtype_planification_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.type_planification_type_appareil
    ADD CONSTRAINT type_planification_type_appareil_idtype_planification_fkey FOREIGN KEY (idtype_planification) REFERENCES sav.type_planification(id);


--
-- TOC entry 6490 (class 2606 OID 1513321)
-- Name: utilisateur_adresse utilisateur_adresse_idadresse_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_adresse
    ADD CONSTRAINT utilisateur_adresse_idadresse_fkey FOREIGN KEY (idadresse) REFERENCES sav.adresse(id);


--
-- TOC entry 6491 (class 2606 OID 1513326)
-- Name: utilisateur_adresse utilisateur_adresse_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_adresse
    ADD CONSTRAINT utilisateur_adresse_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6492 (class 2606 OID 1513331)
-- Name: utilisateur_affectation utilisateur_affectation_idmotif_temps_partiel_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idmotif_temps_partiel_fkey FOREIGN KEY (idmotif_temps_partiel) REFERENCES sav.motif_temps_partiel(id);


--
-- TOC entry 6493 (class 2606 OID 1513336)
-- Name: utilisateur_affectation utilisateur_affectation_idutilisateur_binome_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idutilisateur_binome_fkey FOREIGN KEY (idutilisateur_binome) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6494 (class 2606 OID 1513341)
-- Name: utilisateur_affectation utilisateur_affectation_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6495 (class 2606 OID 1513346)
-- Name: utilisateur_affectation utilisateur_affectation_idutilisateur_planning_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idutilisateur_planning_fkey FOREIGN KEY (idutilisateur_planning) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6496 (class 2606 OID 1513351)
-- Name: utilisateur_affectation utilisateur_affectation_idutilisateur_profil_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idutilisateur_profil_fkey FOREIGN KEY (idutilisateur_profil) REFERENCES sav.utilisateur_profil(id);


--
-- TOC entry 6497 (class 2606 OID 1513356)
-- Name: utilisateur_affectation utilisateur_affectation_idutilisateur_responsable_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_affectation
    ADD CONSTRAINT utilisateur_affectation_idutilisateur_responsable_fkey FOREIGN KEY (idutilisateur_responsable) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6498 (class 2606 OID 1513361)
-- Name: utilisateur_email utilisateur_email_idtype_email_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_email
    ADD CONSTRAINT utilisateur_email_idtype_email_fkey FOREIGN KEY (idtype_email) REFERENCES sav.type_email(id);


--
-- TOC entry 6499 (class 2606 OID 1513366)
-- Name: utilisateur_email utilisateur_email_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_email
    ADD CONSTRAINT utilisateur_email_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6500 (class 2606 OID 1513371)
-- Name: utilisateur_filtre utilisateur_filtre_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_filtre
    ADD CONSTRAINT utilisateur_filtre_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id) NOT VALID;


--
-- TOC entry 6501 (class 2606 OID 1513376)
-- Name: utilisateur_filtre utilisateur_filtre_idutilisateur_role_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_filtre
    ADD CONSTRAINT utilisateur_filtre_idutilisateur_role_fkey FOREIGN KEY (idutilisateur_role) REFERENCES sav.utilisateur_role(id) NOT VALID;


--
-- TOC entry 6484 (class 2606 OID 1513381)
-- Name: utilisateur utilisateur_idagence_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_idagence_fkey FOREIGN KEY (idagence) REFERENCES sav.agence(id);


--
-- TOC entry 6485 (class 2606 OID 1513386)
-- Name: utilisateur utilisateur_idtype_login_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_idtype_login_fkey FOREIGN KEY (idtype_login) REFERENCES sav.type_login(id);


--
-- TOC entry 6486 (class 2606 OID 1513391)
-- Name: utilisateur utilisateur_idtype_utilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_idtype_utilisateur_fkey FOREIGN KEY (idtype_utilisateur) REFERENCES sav.type_utilisateur(id);


--
-- TOC entry 6487 (class 2606 OID 1513396)
-- Name: utilisateur utilisateur_idutilisateur_role_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_idutilisateur_role_fkey FOREIGN KEY (idutilisateur_role) REFERENCES sav.utilisateur_role(id) NOT VALID;


--
-- TOC entry 6488 (class 2606 OID 1513401)
-- Name: utilisateur utilisateur_idutilisateur_valide_conges_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_idutilisateur_valide_conges_fkey FOREIGN KEY (idutilisateur_valide_conges) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6489 (class 2606 OID 1513406)
-- Name: utilisateur utilisateur_role; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur
    ADD CONSTRAINT utilisateur_role FOREIGN KEY (role_id) REFERENCES sav.utilisateur_role(id) NOT VALID;


--
-- TOC entry 6503 (class 2606 OID 1513411)
-- Name: utilisateur_site utilisateur_site_idsite_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_site
    ADD CONSTRAINT utilisateur_site_idsite_fkey FOREIGN KEY (idsite) REFERENCES sav.site(id);


--
-- TOC entry 6504 (class 2606 OID 1513416)
-- Name: utilisateur_site utilisateur_site_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_site
    ADD CONSTRAINT utilisateur_site_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6505 (class 2606 OID 1513421)
-- Name: utilisateur_tel utilisateur_tel_idtype_tel_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_tel
    ADD CONSTRAINT utilisateur_tel_idtype_tel_fkey FOREIGN KEY (idtype_tel) REFERENCES sav.type_tel(id);


--
-- TOC entry 6506 (class 2606 OID 1513426)
-- Name: utilisateur_tel utilisateur_tel_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_tel
    ADD CONSTRAINT utilisateur_tel_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


--
-- TOC entry 6502 (class 2606 OID 1513431)
-- Name: utilisateur_filtre utilsateur_filtre_idutilisateur_fkey; Type: FK CONSTRAINT; Schema: sav; Owner: frisquet
--

ALTER TABLE ONLY sav.utilisateur_filtre
    ADD CONSTRAINT utilsateur_filtre_idutilisateur_fkey FOREIGN KEY (idutilisateur) REFERENCES sav.utilisateur(id);


ALTER TABLE ONLY sav.validation_technique_classification
    ADD CONSTRAINT validation_technique_classification_pkey PRIMARY KEY (id);
ALTER TABLE ONLY sav.validation_technique_pdc
    ADD CONSTRAINT validation_technique_pdc_pkey PRIMARY KEY (id);
ALTER TABLE ONLY sav.intervention_validation_technique_pdc
    ADD CONSTRAINT intervention_validation_technique_pdc_pkey PRIMARY KEY (idintervention, idvalidation_technique_pdc);

ALTER TABLE ONLY sav.validation_technique_pdc
    ADD CONSTRAINT validation_technique_pdc_idvalidation_technique_classification_fkey FOREIGN KEY (idvalidation_technique_classification) REFERENCES sav.validation_technique_classification(id);
ALTER TABLE ONLY sav.intervention_validation_technique_pdc
    ADD CONSTRAINT intervention_validation_technique_pdc_idintervention_fkey FOREIGN KEY (idintervention) REFERENCES sav.intervention(id);
ALTER TABLE ONLY sav.intervention_validation_technique_pdc
    ADD CONSTRAINT intervention_validation_technique_pdc_idvalidation_technique_pdc_fkey FOREIGN KEY (idvalidation_technique_pdc) REFERENCES sav.validation_technique_pdc(id);

--
-- TOC entry 6647 (class 0 OID 0)
-- Dependencies: 8
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2026-01-26 16:31:13

--
--

