--
--


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';



--
-- Name: adresses_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE adresses_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.adresses_seq OWNER TO postgres;



--
-- Name: adresses; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE adresses (
    id integer DEFAULT nextval('adresses_seq'::regclass),
    adminid integer,
    type text,
    societe text,
    nom text,
    prenom text,
    adresse text,
    code_postal text,
    ville text,
    pays text,
    pays_code text
);


ALTER TABLE public.adresses OWNER TO postgres;

--
-- Name: adresses_pays_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE adresses_pays_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.adresses_pays_seq OWNER TO postgres;

--
-- Name: adresses_pays_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE adresses_pays_seq OWNED BY adresses.pays;


--
-- Name: clients; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE clients (
    idclient integer NOT NULL,
    codecli character varying NOT NULL,
    nomsoc character varying NOT NULL,
    adress character varying,
    cp character varying,
    ville character varying,
    pays character varying,
    tel character varying,
    fax character varying,
    email character varying,
    website character varying,
    client_entreprise character varying DEFAULT 1 NOT NULL,
    client_colab character varying DEFAULT 0 NOT NULL,
    idadmin integer,
    time_crea timestamp without time zone DEFAULT now() NOT NULL,
    time_supp timestamp without time zone,
    actif integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.clients OWNER TO postgres;

--
-- Name: clients_idclient_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE clients_idclient_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clients_idclient_seq OWNER TO postgres;

--
-- Name: clients_idclient_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE clients_idclient_seq OWNED BY clients.idclient;


--
-- Name: coala_config; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE coala_config (
    userid integer DEFAULT 0 NOT NULL,
    ecartmax integer DEFAULT (600)::numeric NOT NULL,
    tolerance integer DEFAULT (59)::numeric NOT NULL,
    pausedej integer DEFAULT (3600)::numeric NOT NULL,
    min_facturable integer DEFAULT (600)::numeric NOT NULL,
    min_inactivite integer DEFAULT (59)::numeric NOT NULL,
    min_dejeuner integer DEFAULT (900)::numeric NOT NULL,
    debut_dej character varying(5) DEFAULT '11:30'::character varying NOT NULL,
    fin_dej character varying(5) DEFAULT '14:30'::character varying NOT NULL,
    coalaname character varying(20) DEFAULT '0'::character varying NOT NULL
);


ALTER TABLE public.coala_config OWNER TO postgres;

--
-- Name: code; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE code (
    libel character varying,
    code character varying,
    idadmin character varying,
    mother character varying,
    price character varying,
    idcode integer NOT NULL,
    original character varying
);


ALTER TABLE public.code OWNER TO postgres;

--
-- Name: code_idcode_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE code_idcode_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.code_idcode_seq OWNER TO postgres;

--
-- Name: code_idcode_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE code_idcode_seq OWNED BY code.idcode;


--
-- Name: droits_ut; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE droits_ut (
    id integer NOT NULL,
    config integer DEFAULT 0 NOT NULL,
    auto integer DEFAULT 0 NOT NULL,
    sclient integer DEFAULT 0 NOT NULL,
    sfiltre integer DEFAULT 0 NOT NULL,
    idadmin integer DEFAULT 0 NOT NULL,
    export character varying DEFAULT 0 NOT NULL,
    password text
);


ALTER TABLE public.droits_ut OWNER TO postgres;

--
-- Name: factures_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE factures_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.factures_seq OWNER TO postgres;

--
-- Name: factures; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE factures (
    id integer DEFAULT nextval('factures_seq'::regclass),
    adminid integer,
    date date,
    prix_ht numeric,
    tva numeric,
    prix_ttc numeric,
    nombre_postes integer,
    payee boolean,
    annee integer,
    mois integer,
    type text,
    nom text,
    prenom text,
    societe text,
    adresse text,
    code_postal text,
    ville text,
    pays text,
    code_pays text
);


ALTER TABLE public.factures OWNER TO postgres;

--
-- Name: filedump; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE filedump (
    userid integer DEFAULT 0 NOT NULL,
    date character varying(40) NOT NULL,
    heure character varying(40) NOT NULL,
    userco character varying(40) NOT NULL,
    client character varying(40) NOT NULL,
    activite character varying(40) NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    idadmin integer NOT NULL
);


ALTER TABLE public.filedump OWNER TO postgres;

--
-- Name: filedump2; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE filedump2 (
    userid integer DEFAULT 0 NOT NULL,
    date character varying NOT NULL,
    heure character varying(40) NOT NULL,
    userco character varying(40) NOT NULL,
    client character varying(40) NOT NULL,
    activite character varying(40) NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    idadmin integer NOT NULL
);


ALTER TABLE public.filedump2 OWNER TO postgres;

--
-- Name: filtres_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE filtres_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.filtres_id_seq OWNER TO postgres;

--
-- Name: filtres; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE filtres (
    adminid integer NOT NULL,
    secret integer DEFAULT 0 NOT NULL,
    libelle text NOT NULL,
    contenant text NOT NULL,
    contenu text NOT NULL,
    client text NOT NULL,
    prestation text NOT NULL,
    prestationid integer NOT NULL,
    id integer DEFAULT nextval('filtres_id_seq'::regclass) NOT NULL,
    propriete text NOT NULL
);


ALTER TABLE public.filtres OWNER TO postgres;

--
-- Name: historiq; Type: TABLE; Schema: public; Owner: chronos; Tablespace: 
--

CREATE TABLE historiq (
    id integer NOT NULL,
    libel text,
    userid integer,
    admin integer,
    businesstag text,
    userip text,
    date text,
    "time" text
);


ALTER TABLE public.historiq OWNER TO chronos;

--
-- Name: historiq_id_seq; Type: SEQUENCE; Schema: public; Owner: chronos
--

CREATE SEQUENCE historiq_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.historiq_id_seq OWNER TO chronos;

--
-- Name: historiq_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: chronos
--

ALTER SEQUENCE historiq_id_seq OWNED BY historiq.id;


--
-- Name: inscrits; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE inscrits (
    id integer NOT NULL,
    login character varying(40) NOT NULL,
    pass character varying(41) NOT NULL,
    nom character varying(40) NOT NULL,
    prenom character varying(40) NOT NULL,
    societe character varying(40) NOT NULL,
    email character varying(40) NOT NULL,
    "timestamp" timestamp without time zone DEFAULT now() NOT NULL,
    actkey character varying(40) NOT NULL,
    keycode character varying(15) NOT NULL,
    admin bytea NOT NULL,
    idadmin integer
);


ALTER TABLE public.inscrits OWNER TO postgres;

--
-- Name: inscrits_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "inscrits_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."inscrits_ID_seq" OWNER TO postgres;

--
-- Name: inscrits_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "inscrits_ID_seq" OWNED BY inscrits.id;


--
-- Name: keywords_ID; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "keywords_ID"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."keywords_ID" OWNER TO postgres;

--
-- Name: keywords; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE keywords (
    userid integer NOT NULL,
    processus text,
    libelle text,
    action text,
    client text,
    prestation text,
    keyid integer DEFAULT nextval('"keywords_ID"'::regclass) NOT NULL
);


ALTER TABLE public.keywords OWNER TO postgres;

--
-- Name: TABLE keywords; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE keywords IS 'analyse et lignes indesirées';


--
-- Name: COLUMN keywords.userid; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.userid IS 'id user';


--
-- Name: COLUMN keywords.processus; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.processus IS 'processus/programme';


--
-- Name: COLUMN keywords.libelle; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.libelle IS 'libelle fenetre';


--
-- Name: COLUMN keywords.action; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.action IS 'cacher/client=/presta=/client+presta=';


--
-- Name: COLUMN keywords.client; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.client IS 'client';


--
-- Name: COLUMN keywords.prestation; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN keywords.prestation IS 'id prestation';


--
-- Name: licence; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE licence (
    id integer NOT NULL,
    userid integer DEFAULT 0 NOT NULL,
    postes integer DEFAULT 0 NOT NULL,
    coala boolean DEFAULT false NOT NULL,
    watcher boolean DEFAULT false NOT NULL,
    valid boolean DEFAULT true NOT NULL,
    keycode character varying DEFAULT 0 NOT NULL,
    datedebut integer DEFAULT 1296514800,
    datefin bigint DEFAULT 1391209200 NOT NULL
);


ALTER TABLE public.licence OWNER TO postgres;

--
-- Name: licence_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "licence_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."licence_ID_seq" OWNER TO postgres;

--
-- Name: licence_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "licence_ID_seq" OWNED BY licence.id;


--
-- Name: licence_datefin_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE licence_datefin_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.licence_datefin_seq OWNER TO postgres;

--
-- Name: licence_datefin_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE licence_datefin_seq OWNED BY licence.datefin;


--
-- Name: logcondensed; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE logcondensed (
    id integer NOT NULL,
    userid integer DEFAULT 0 NOT NULL,
    date character varying(12) NOT NULL,
    heure character varying(12) NOT NULL,
    nomfenetre character varying NOT NULL,
    processus character varying NOT NULL,
    chemin character varying NOT NULL,
    client text NOT NULL,
    posteid integer DEFAULT 0 NOT NULL,
    final_userid integer DEFAULT 0 NOT NULL,
    activite character varying(40) NOT NULL,
    action character varying(20) NOT NULL,
    clicks integer,
    valid character varying DEFAULT 1 NOT NULL,
    file text DEFAULT 0,
    line integer DEFAULT 0
);


ALTER TABLE public.logcondensed OWNER TO postgres;

--
-- Name: logcondensed_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "logcondensed_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."logcondensed_ID_seq" OWNER TO postgres;

--
-- Name: logcondensed_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "logcondensed_ID_seq" OWNED BY logcondensed.id;


--
-- Name: logfull; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE logfull (
    id integer NOT NULL,
    userid integer DEFAULT 0 NOT NULL,
    date date DEFAULT '1753-01-01'::date NOT NULL,
    heure time without time zone DEFAULT '00:00:00'::time without time zone NOT NULL,
    nomfenetre text NOT NULL,
    processus text NOT NULL,
    chemin text NOT NULL,
    action text NOT NULL,
    posteid integer DEFAULT 0 NOT NULL,
    client text NOT NULL,
    activite character varying(40) NOT NULL,
    clicks integer,
    final_userid character varying DEFAULT 0 NOT NULL,
    valid character varying DEFAULT 1 NOT NULL,
    line integer DEFAULT 0,
    file text DEFAULT 0
);


ALTER TABLE public.logfull OWNER TO postgres;

--
-- Name: logfull_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "logfull_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."logfull_ID_seq" OWNER TO postgres;

--
-- Name: logfull_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "logfull_ID_seq" OWNED BY logfull.id;


--
-- Name: logmaj; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE logmaj (
    datemaj timestamp without time zone NOT NULL,
    nomfichier character varying(40) NOT NULL,
    line text NOT NULL,
    posteid integer DEFAULT 0 NOT NULL,
    userid integer,
    start text,
    type character varying(10)
);


ALTER TABLE public.logmaj OWNER TO postgres;

--
-- Name: logview; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE logview (
    id integer NOT NULL,
    userid integer DEFAULT 0 NOT NULL,
    date character varying(12) NOT NULL,
    heure character varying(12) NOT NULL,
    nomfenetre character varying(120) NOT NULL,
    processus character varying(100) NOT NULL,
    chemin character varying(50) NOT NULL,
    client character varying(20) NOT NULL,
    posteid integer DEFAULT 0 NOT NULL,
    final_userid integer DEFAULT 0 NOT NULL,
    activite character varying(40) NOT NULL,
    action character varying(30) NOT NULL,
    clicks integer
);


ALTER TABLE public.logview OWNER TO postgres;

--
-- Name: logview_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE logview_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.logview_id_seq OWNER TO postgres;

--
-- Name: logview_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE logview_id_seq OWNED BY logview.id;


--
-- Name: postes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE postes (
    id integer NOT NULL,
    postename text NOT NULL,
    userid integer DEFAULT 0,
    datefin character varying NOT NULL,
    guid character varying(50),
    activated bytea NOT NULL,
    idadmin character varying,
    actif integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.postes OWNER TO postgres;

--
-- Name: COLUMN postes.actif; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN postes.actif IS 'contre l''obsolescence du lien';


--
-- Name: postes_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "postes_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."postes_ID_seq" OWNER TO postgres;

--
-- Name: postes_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "postes_ID_seq" OWNED BY postes.id;


--
-- Name: presence; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE presence (
    userid integer DEFAULT 0 NOT NULL,
    userco character varying(30) NOT NULL,
    date character varying(10) NOT NULL,
    mois character varying(10) NOT NULL,
    presence character varying(30) NOT NULL,
    cumul character varying(30) NOT NULL,
    an character varying(10) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    idadmin integer NOT NULL,
    ttecumul character varying DEFAULT 0 NOT NULL,
    valid integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.presence OWNER TO postgres;

--
-- Name: presence_watcher; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE presence_watcher (
    userid integer DEFAULT 0 NOT NULL,
    date character varying NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    presence character varying(30) NOT NULL,
    cumul character varying(30) NOT NULL,
    idadmin integer NOT NULL,
    valid integer DEFAULT 0 NOT NULL,
    factcumul character varying(30) DEFAULT 0 NOT NULL,
    posteid integer
);


ALTER TABLE public.presence_watcher OWNER TO postgres;

--
-- Name: presence_watcherr; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE presence_watcherr (
    useridrr integer DEFAULT 0 NOT NULL,
    date character varying NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    presence character varying(30) NOT NULL,
    cumul character varying(30) NOT NULL,
    idadmin integer NOT NULL,
    valid integer DEFAULT 0 NOT NULL,
    factcumul character varying(30) DEFAULT 0 NOT NULL,
    "integer" integer,
    posteid integer
);


ALTER TABLE public.presence_watcherr OWNER TO postgres;

--
-- Name: prestations; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE prestations (
    libel character varying NOT NULL,
    rang integer NOT NULL,
    mother integer,
    idadmin integer,
    idpres integer NOT NULL,
    codepresta character varying,
    actif integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.prestations OWNER TO postgres;

--
-- Name: prestations_idpres_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE prestations_idpres_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prestations_idpres_seq OWNER TO postgres;

--
-- Name: prestations_idpres_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE prestations_idpres_seq OWNED BY prestations.idpres;


--
-- Name: relation; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE relation (
    id_sup integer,
    type_sup text,
    type_ref text,
    name text,
    id_ref integer
);


ALTER TABLE public.relation OWNER TO postgres;

--
-- Name: TABLE relation; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON TABLE relation IS 'adm sup';


--
-- Name: spot; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE spot (
    libel character varying NOT NULL,
    rang integer NOT NULL,
    mother integer,
    idadmin integer,
    idspot integer NOT NULL,
    codespot character varying,
    actif integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.spot OWNER TO postgres;

--
-- Name: spot_idspot_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE spot_idspot_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.spot_idspot_seq OWNER TO postgres;

--
-- Name: spot_idspot_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE spot_idspot_seq OWNED BY spot.idspot;


--
-- Name: taches; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE taches (
    "ID" integer NOT NULL,
    "final_userID" integer DEFAULT 0 NOT NULL,
    "posteID" integer DEFAULT 0 NOT NULL,
    "Client" character varying(50) NOT NULL,
    "Code_tarif" character varying(15) NOT NULL,
    "debutID" integer DEFAULT 0 NOT NULL,
    "finID" integer DEFAULT 0 NOT NULL,
    libelle character varying(50) NOT NULL
);


ALTER TABLE public.taches OWNER TO postgres;

--
-- Name: taches_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "taches_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."taches_ID_seq" OWNER TO postgres;

--
-- Name: taches_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "taches_ID_seq" OWNED BY taches."ID";


--
-- Name: temps; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE temps (
    idtemps integer NOT NULL,
    userid integer DEFAULT 0 NOT NULL,
    date character varying(10) NOT NULL,
    client character varying(40) NOT NULL,
    debut character varying(10) NOT NULL,
    fin character varying(10) NOT NULL,
    tempsclient integer DEFAULT 0 NOT NULL,
    userco character varying(40) NOT NULL,
    activite character varying(30) NOT NULL,
    mois character varying(10) NOT NULL,
    source character varying(30) NOT NULL,
    an character varying(10) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    idadmin integer NOT NULL,
    tte integer DEFAULT 0 NOT NULL,
    commentary text
);


ALTER TABLE public.temps OWNER TO postgres;

--
-- Name: temps_IDtemps_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "temps_IDtemps_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."temps_IDtemps_seq" OWNER TO postgres;

--
-- Name: temps_IDtemps_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "temps_IDtemps_seq" OWNED BY temps.idtemps;


--
-- Name: temps_watcher; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE temps_watcher (
    idtempg integer NOT NULL,
    iduser integer DEFAULT 0 NOT NULL,
    date character varying NOT NULL,
    debut character varying(10) NOT NULL,
    fin character varying(10) NOT NULL,
    tpsacticompt integer DEFAULT 0 NOT NULL,
    tpsfactcompt integer DEFAULT 0 NOT NULL,
    nomfenetre character varying NOT NULL,
    processus character varying NOT NULL,
    client character varying(40) NOT NULL,
    activite character varying(30) NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    action character varying(30) NOT NULL,
    idadmin integer NOT NULL,
    posteid integer
);


ALTER TABLE public.temps_watcher OWNER TO postgres;

--
-- Name: temps_watcher_idtempg_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE temps_watcher_idtempg_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.temps_watcher_idtempg_seq OWNER TO postgres;

--
-- Name: temps_watcher_idtempg_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE temps_watcher_idtempg_seq OWNED BY temps_watcher.idtempg;


--
-- Name: temps_watcherr; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE temps_watcherr (
    idtempg integer NOT NULL,
    iduserr integer DEFAULT 0 NOT NULL,
    date character varying NOT NULL,
    debut character varying(10) NOT NULL,
    fin character varying(10) NOT NULL,
    tpsacticompt integer DEFAULT 0 NOT NULL,
    tpsfactcompt integer DEFAULT 0 NOT NULL,
    nomfenetre character varying NOT NULL,
    processus character varying NOT NULL,
    client character varying(40) NOT NULL,
    activite character varying(30) NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    action character varying(30) NOT NULL,
    idadmin integer NOT NULL,
    posteid integer
);


ALTER TABLE public.temps_watcherr OWNER TO postgres;

--
-- Name: temps_watcherr_idtempg_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE temps_watcherr_idtempg_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.temps_watcherr_idtempg_seq OWNER TO postgres;

--
-- Name: temps_watcherr_idtempg_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE temps_watcherr_idtempg_seq OWNED BY temps_watcherr.idtempg;


--
-- Name: tempsclient; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tempsclient (
    userid integer DEFAULT 0 NOT NULL,
    userco character varying(30) NOT NULL,
    client character varying(30) NOT NULL,
    date character varying(10) NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    tempsclient character varying(30) NOT NULL,
    activite character varying(30) NOT NULL,
    "timestamp" timestamp without time zone NOT NULL,
    idadmin integer NOT NULL,
    ttecumul character varying DEFAULT 0 NOT NULL,
    code character varying,
    periode character varying,
    posteid integer NOT NULL
);


ALTER TABLE public.tempsclient OWNER TO postgres;

--
-- Name: tempsclient_posteid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE tempsclient_posteid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tempsclient_posteid_seq OWNER TO postgres;

--
-- Name: tempsclient_posteid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE tempsclient_posteid_seq OWNED BY tempsclient.posteid;


--
-- Name: tempsclient_watcher; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tempsclient_watcher (
    userid integer DEFAULT 0 NOT NULL,
    client character varying(30) NOT NULL,
    date character varying NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    tpsacticumul character varying(30) NOT NULL,
    activite character varying(30) NOT NULL,
    "timestamp" timestamp without time zone,
    idadmin integer NOT NULL,
    tpsfactcumul character varying(30) NOT NULL,
    code character varying,
    periode character varying,
    posteid integer
);


ALTER TABLE public.tempsclient_watcher OWNER TO postgres;

--
-- Name: tempsclient_watcherr; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE tempsclient_watcherr (
    useridr integer DEFAULT 0 NOT NULL,
    client character varying(30) NOT NULL,
    date character varying NOT NULL,
    mois character varying(10) NOT NULL,
    an character varying(10) NOT NULL,
    tpsacticumul character varying(30) NOT NULL,
    activite character varying(30) NOT NULL,
    "timestamp" timestamp without time zone,
    idadmin integer NOT NULL,
    tpsfactcumul character varying(30) NOT NULL,
    code character varying,
    periode character varying,
    posteid integer
);


ALTER TABLE public.tempsclient_watcherr OWNER TO postgres;

--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE users (
    id integer NOT NULL,
    login character varying(40) NOT NULL,
    pass character varying(41) NOT NULL,
    nom character varying(40) NOT NULL,
    prenom character varying(40) NOT NULL,
    societe character varying(40) NOT NULL,
    email character varying(40) NOT NULL,
    actkey character varying(40) NOT NULL,
    keycode character varying(15) DEFAULT '0'::character varying NOT NULL,
    admin text NOT NULL,
    time_crea time without time zone DEFAULT now() NOT NULL,
    connect_watcher integer DEFAULT 0 NOT NULL,
    connect_site integer DEFAULT 0 NOT NULL,
    time_supp timestamp without time zone,
    actif integer DEFAULT 1 NOT NULL,
    idadmin character varying,
    issup text DEFAULT 0,
    serverip inet DEFAULT '62.210.195.95'::inet,
    serverdomain text DEFAULT 'http://www.chronosmonitor.com'::text,
    telephone text,
    vecteur text,
    mode text DEFAULT 'PROJECTS'::text,
    "business-tag" text
);


ALTER TABLE public.users OWNER TO postgres;

--
-- Name: users_ID_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "users_ID_seq"
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public."users_ID_seq" OWNER TO postgres;

--
-- Name: users_ID_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "users_ID_seq" OWNED BY users.id;


--
-- Name: watcher_config; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE watcher_config (
    userid integer DEFAULT 0 NOT NULL,
    ecartmax integer DEFAULT (600)::numeric NOT NULL,
    tolerance integer DEFAULT (600)::numeric NOT NULL,
    pausedej integer DEFAULT (3600)::numeric NOT NULL,
    min_facturable integer DEFAULT (600)::numeric NOT NULL,
    min_inactivite integer DEFAULT (600)::numeric NOT NULL,
    min_dejeuner integer DEFAULT (1800)::numeric NOT NULL,
    debut_dej character varying(5) DEFAULT '11:30'::character varying NOT NULL,
    fin_dej character varying(5) DEFAULT '14:30'::character varying NOT NULL
);


ALTER TABLE public.watcher_config OWNER TO postgres;

--
-- Name: idclient; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY clients ALTER COLUMN idclient SET DEFAULT nextval('clients_idclient_seq'::regclass);


--
-- Name: idcode; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY code ALTER COLUMN idcode SET DEFAULT nextval('code_idcode_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: chronos
--

ALTER TABLE ONLY historiq ALTER COLUMN id SET DEFAULT nextval('historiq_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY inscrits ALTER COLUMN id SET DEFAULT nextval('"inscrits_ID_seq"'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY licence ALTER COLUMN id SET DEFAULT nextval('"licence_ID_seq"'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY logcondensed ALTER COLUMN id SET DEFAULT nextval('"logcondensed_ID_seq"'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY logfull ALTER COLUMN id SET DEFAULT nextval('"logfull_ID_seq"'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY logview ALTER COLUMN id SET DEFAULT nextval('logview_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY postes ALTER COLUMN id SET DEFAULT nextval('"postes_ID_seq"'::regclass);


--
-- Name: idpres; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY prestations ALTER COLUMN idpres SET DEFAULT nextval('prestations_idpres_seq'::regclass);


--
-- Name: idspot; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY spot ALTER COLUMN idspot SET DEFAULT nextval('spot_idspot_seq'::regclass);


--
-- Name: ID; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY taches ALTER COLUMN "ID" SET DEFAULT nextval('"taches_ID_seq"'::regclass);


--
-- Name: idtemps; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY temps ALTER COLUMN idtemps SET DEFAULT nextval('"temps_IDtemps_seq"'::regclass);


--
-- Name: idtempg; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY temps_watcher ALTER COLUMN idtempg SET DEFAULT nextval('temps_watcher_idtempg_seq'::regclass);


--
-- Name: idtempg; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY temps_watcherr ALTER COLUMN idtempg SET DEFAULT nextval('temps_watcherr_idtempg_seq'::regclass);


--
-- Name: posteid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY tempsclient ALTER COLUMN posteid SET DEFAULT nextval('tempsclient_posteid_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('"users_ID_seq"'::regclass);


--
-- Name: adresses_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY adresses
    ADD CONSTRAINT adresses_id_key UNIQUE (id);


--
-- Name: clients_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY clients
    ADD CONSTRAINT clients_pkey PRIMARY KEY (idclient);


--
-- Name: coala_config_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY coala_config
    ADD CONSTRAINT coala_config_pkey PRIMARY KEY (userid);


--
-- Name: historiq_id_key; Type: CONSTRAINT; Schema: public; Owner: chronos; Tablespace: 
--

ALTER TABLE ONLY historiq
    ADD CONSTRAINT historiq_id_key UNIQUE (id);


--
-- Name: inscrits_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY inscrits
    ADD CONSTRAINT inscrits_pkey PRIMARY KEY (id);


--
-- Name: licence_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY licence
    ADD CONSTRAINT licence_pkey PRIMARY KEY (id);


--
-- Name: logcondensed_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY logcondensed
    ADD CONSTRAINT logcondensed_pkey PRIMARY KEY (id);


--
-- Name: logfull_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY logfull
    ADD CONSTRAINT logfull_pkey PRIMARY KEY (id);


--
-- Name: logview_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY logview
    ADD CONSTRAINT logview_pkey PRIMARY KEY (id);


--
-- Name: postes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY postes
    ADD CONSTRAINT postes_pkey PRIMARY KEY (id);


--
-- Name: presence_watcher_userID_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY presence_watcher
    ADD CONSTRAINT "presence_watcher_userID_key" UNIQUE (userid, date, idadmin);


--
-- Name: presence_watcherr_userIDrr_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY presence_watcherr
    ADD CONSTRAINT "presence_watcherr_userIDrr_key" UNIQUE (useridrr, date, idadmin);


--
-- Name: prestations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY prestations
    ADD CONSTRAINT prestations_pkey PRIMARY KEY (idpres);


--
-- Name: spot_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY spot
    ADD CONSTRAINT spot_pkey PRIMARY KEY (idspot);


--
-- Name: taches_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY taches
    ADD CONSTRAINT taches_pkey PRIMARY KEY ("ID");


--
-- Name: temps_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY temps
    ADD CONSTRAINT temps_pkey PRIMARY KEY (idtemps);


--
-- Name: temps_watcher_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY temps_watcher
    ADD CONSTRAINT temps_watcher_pkey PRIMARY KEY (idtempg);


--
-- Name: temps_watcherr_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY temps_watcherr
    ADD CONSTRAINT temps_watcherr_pkey PRIMARY KEY (idtempg);


--
-- Name: tempsclient_watcher_userID_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tempsclient_watcher
    ADD CONSTRAINT "tempsclient_watcher_userID_key" UNIQUE (userid, date, client, activite, idadmin);


--
-- Name: tempsclient_watcherr_userIDr_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY tempsclient_watcherr
    ADD CONSTRAINT "tempsclient_watcherr_userIDr_key" UNIQUE (useridr, date, client, activite, idadmin);


--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: watcher_config_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY watcher_config
    ADD CONSTRAINT watcher_config_pkey PRIMARY KEY (userid);


--
-- Name: iduser; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX iduser ON temps_watcher USING btree (iduser, date, nomfenetre, processus, mois);


--
-- Name: iduserr; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX iduserr ON temps_watcherr USING btree (iduserr, date, nomfenetre, processus, mois);


--
-- Name: userID; Type: INDEX; Schema: public; Owner: postgres; Tablespace: 
--

CREATE INDEX "userID" ON temps USING btree (userid, date, client, userco, mois);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

