--
--

-- Started on 2009-05-18 22:01:44 CEST

SET escape_string_warning = off;

--
-- TOC entry 1750 (class 1262 OID 16394)
-- Name: appart; Type: DATABASE; Schema: -; Owner: -
--

CREATE DATABASE appart WITH TEMPLATE = template0 ENCODING = 'UTF8';


\connect appart

SET escape_string_warning = off;

--
-- TOC entry 294 (class 2612 OID 16506)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: -
--

CREATE PROCEDURAL LANGUAGE plpgsql;



--
-- TOC entry 1466 (class 1259 OID 16507)
-- Dependencies: 3
-- Name: appart_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE appart_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;




--
-- TOC entry 1467 (class 1259 OID 16509)
-- Dependencies: 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 3
-- Name: appart; Type: TABLE; Schema: public; Owner: -; Tablespace: 
--

CREATE TABLE appart (
    id integer DEFAULT nextval('appart_id_seq'::regclass) NOT NULL,
    prix numeric(28,0),
    prixcharges numeric(10,0),
    rue text DEFAULT ''::text NOT NULL,
    nbpiece character varying(28),
    surface numeric(28,0),
    description text DEFAULT ''::text NOT NULL,
    contact text DEFAULT ''::text NOT NULL,
    url character varying(200) DEFAULT ''::character varying NOT NULL,
    etage numeric(5,0),
    annee_construction numeric(28,0),
    points_positifs text DEFAULT ''::text NOT NULL,
    points_negatifs text DEFAULT ''::text NOT NULL,
    visite_indications text DEFAULT ''::text NOT NULL,
    statut smallint DEFAULT 0 NOT NULL,
    localite character varying(100) DEFAULT ''::character varying,
    date_visite timestamp without time zone,
    date_libre date,
    url_map text DEFAULT ''::text
);


--
-- TOC entry 1753 (class 0 OID 0)
-- Dependencies: 1467
-- Name: COLUMN appart.statut; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN appart.statut IS 'statut : 0 = pas visité, 1 = visité, 2 = déjà pris, 3 = rdv pris';


--
-- TOC entry 1468 (class 1259 OID 16526)
-- Dependencies: 3
-- Name: site_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- TOC entry 1747 (class 2606 OID 16536)
-- Dependencies: 1467 1467
-- Name: appart_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: 
--

ALTER TABLE ONLY appart
    ADD CONSTRAINT appart_pkey PRIMARY KEY (id);


--
-- TOC entry 1752 (class 0 OID 0)
-- Dependencies: 3
-- Name: public; Type: ACL; Schema: -; Owner: -
--

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;


--
-- TOC entry 1754 (class 0 OID 0)
-- Dependencies: 1467
-- Name: appart; Type: ACL; Schema: public; Owner: -
--

REVOKE ALL ON TABLE appart FROM PUBLIC;
REVOKE ALL ON TABLE appart FROM appart;
GRANT ALL ON TABLE appart TO appart;
GRANT ALL ON TABLE appart TO appart_group;


-- Completed on 2009-05-18 22:01:46 CEST

--
--

