First commit
[appart.git] / DB / empty_db.sql
1 --
2 -- PostgreSQL database dump
3 --
4
5 -- Started on 2009-05-18 22:01:44 CEST
6
7 SET client_encoding = 'UTF8';
8 SET standard_conforming_strings = off;
9 SET check_function_bodies = false;
10 SET client_min_messages = warning;
11 SET escape_string_warning = off;
12
13 --
14 -- TOC entry 1750 (class 1262 OID 16394)
15 -- Name: appart; Type: DATABASE; Schema: -; Owner: -
16 --
17
18 CREATE DATABASE appart WITH TEMPLATE = template0 ENCODING = 'UTF8';
19
20
21 \connect appart
22
23 SET client_encoding = 'UTF8';
24 SET standard_conforming_strings = off;
25 SET check_function_bodies = false;
26 SET client_min_messages = warning;
27 SET escape_string_warning = off;
28
29 --
30 -- TOC entry 294 (class 2612 OID 16506)
31 -- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: -
32 --
33
34 CREATE PROCEDURAL LANGUAGE plpgsql;
35
36
37 SET search_path = public, pg_catalog;
38
39 --
40 -- TOC entry 1466 (class 1259 OID 16507)
41 -- Dependencies: 3
42 -- Name: appart_id_seq; Type: SEQUENCE; Schema: public; Owner: -
43 --
44
45 CREATE SEQUENCE appart_id_seq
46 INCREMENT BY 1
47 NO MAXVALUE
48 NO MINVALUE
49 CACHE 1;
50
51
52 SET default_tablespace = '';
53
54 SET default_with_oids = false;
55
56 --
57 -- TOC entry 1467 (class 1259 OID 16509)
58 -- Dependencies: 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 3
59 -- Name: appart; Type: TABLE; Schema: public; Owner: -; Tablespace:
60 --
61
62 CREATE TABLE appart (
63 id integer DEFAULT nextval('appart_id_seq'::regclass) NOT NULL,
64 prix numeric(28,0),
65 prixcharges numeric(10,0),
66 rue text DEFAULT ''::text NOT NULL,
67 nbpiece character varying(28),
68 surface numeric(28,0),
69 description text DEFAULT ''::text NOT NULL,
70 contact text DEFAULT ''::text NOT NULL,
71 url character varying(200) DEFAULT ''::character varying NOT NULL,
72 etage numeric(5,0),
73 annee_construction numeric(28,0),
74 points_positifs text DEFAULT ''::text NOT NULL,
75 points_negatifs text DEFAULT ''::text NOT NULL,
76 visite_indications text DEFAULT ''::text NOT NULL,
77 statut smallint DEFAULT 0 NOT NULL,
78 localite character varying(100) DEFAULT ''::character varying,
79 date_visite timestamp without time zone,
80 date_libre date,
81 url_map text DEFAULT ''::text
82 );
83
84
85 --
86 -- TOC entry 1753 (class 0 OID 0)
87 -- Dependencies: 1467
88 -- Name: COLUMN appart.statut; Type: COMMENT; Schema: public; Owner: -
89 --
90
91 COMMENT ON COLUMN appart.statut IS 'statut : 0 = pas visité, 1 = visité, 2 = déjà pris, 3 = rdv pris';
92
93
94 --
95 -- TOC entry 1468 (class 1259 OID 16526)
96 -- Dependencies: 3
97 -- Name: site_id_seq; Type: SEQUENCE; Schema: public; Owner: -
98 --
99
100 CREATE SEQUENCE site_id_seq
101 START WITH 1
102 INCREMENT BY 1
103 NO MAXVALUE
104 NO MINVALUE
105 CACHE 1;
106
107
108 --
109 -- TOC entry 1747 (class 2606 OID 16536)
110 -- Dependencies: 1467 1467
111 -- Name: appart_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
112 --
113
114 ALTER TABLE ONLY appart
115 ADD CONSTRAINT appart_pkey PRIMARY KEY (id);
116
117
118 --
119 -- TOC entry 1752 (class 0 OID 0)
120 -- Dependencies: 3
121 -- Name: public; Type: ACL; Schema: -; Owner: -
122 --
123
124 REVOKE ALL ON SCHEMA public FROM PUBLIC;
125 REVOKE ALL ON SCHEMA public FROM postgres;
126 GRANT ALL ON SCHEMA public TO postgres;
127 GRANT ALL ON SCHEMA public TO PUBLIC;
128
129
130 --
131 -- TOC entry 1754 (class 0 OID 0)
132 -- Dependencies: 1467
133 -- Name: appart; Type: ACL; Schema: public; Owner: -
134 --
135
136 REVOKE ALL ON TABLE appart FROM PUBLIC;
137 REVOKE ALL ON TABLE appart FROM appart;
138 GRANT ALL ON TABLE appart TO appart;
139 GRANT ALL ON TABLE appart TO appart_group;
140
141
142 -- Completed on 2009-05-18 22:01:46 CEST
143
144 --
145 -- PostgreSQL database dump complete
146 --
147