git_sitools_idoc / flarecast / database / PGSQL / pgsql_sitools.sql @ master
1 |
--
|
---|---|
2 |
-- PostgreSQL database dump
|
3 |
--
|
4 |
|
5 |
-- Started on 2011-04-13 18:14:28
|
6 |
|
7 |
SET statement_timeout = 0; |
8 |
SET client_encoding = 'UTF8'; |
9 |
SET standard_conforming_strings = off;
|
10 |
SET check_function_bodies = false; |
11 |
SET client_min_messages = warning;
|
12 |
SET escape_string_warning = off;
|
13 |
|
14 |
--
|
15 |
-- TOC entry 8 (class 2615 OID 16572)
|
16 |
-- Name: sitools; Type: SCHEMA; Schema: -; Owner: sitools
|
17 |
--
|
18 |
|
19 |
CREATE SCHEMA sitools;
|
20 |
|
21 |
|
22 |
ALTER SCHEMA sitools OWNER TO sitools; |
23 |
|
24 |
SET search_path = sitools, pg_catalog;
|
25 |
|
26 |
SET default_tablespace = ''; |
27 |
|
28 |
SET default_with_oids = false; |
29 |
|
30 |
--
|
31 |
-- TOC entry 1591 (class 1259 OID 16665)
|
32 |
-- Dependencies: 8
|
33 |
-- Name: GROUPS; Type: TABLE; Schema: sitools; Owner: sitools; Tablespace:
|
34 |
--
|
35 |
|
36 |
CREATE TABLE "GROUPS" ( |
37 |
name character varying(32) NOT NULL, |
38 |
description character varying(128)
|
39 |
); |
40 |
|
41 |
|
42 |
ALTER TABLE sitools."GROUPS" OWNER TO sitools; |
43 |
|
44 |
--
|
45 |
-- TOC entry 1592 (class 1259 OID 16677)
|
46 |
-- Dependencies: 8
|
47 |
-- Name: USERS; Type: TABLE; Schema: sitools; Owner: sitools; Tablespace:
|
48 |
--
|
49 |
|
50 |
CREATE TABLE "USERS" ( |
51 |
identifier character varying(64) NOT NULL, |
52 |
firstname character varying(32),
|
53 |
lastname character varying(32),
|
54 |
email character varying(128),
|
55 |
secret character varying(40)
|
56 |
); |
57 |
|
58 |
|
59 |
ALTER TABLE sitools."USERS" OWNER TO sitools; |
60 |
|
61 |
--
|
62 |
-- TOC entry 1593 (class 1259 OID 16680)
|
63 |
-- Dependencies: 8
|
64 |
-- Name: USER_GROUP; Type: TABLE; Schema: sitools; Owner: sitools; Tablespace:
|
65 |
--
|
66 |
|
67 |
CREATE TABLE "USER_GROUP" ( |
68 |
identifier character varying(64) NOT NULL, |
69 |
name character varying(32) NOT NULL |
70 |
); |
71 |
|
72 |
|
73 |
ALTER TABLE sitools."USER_GROUP" OWNER TO sitools; |
74 |
|
75 |
--
|
76 |
-- TOC entry 1594 (class 1259 OID 16683)
|
77 |
-- Dependencies: 8
|
78 |
-- Name: USER_PROPERTIES; Type: TABLE; Schema: sitools; Owner: sitools; Tablespace:
|
79 |
--
|
80 |
|
81 |
CREATE TABLE "USER_PROPERTIES" ( |
82 |
key character varying(64) NOT NULL, |
83 |
value character varying(256),
|
84 |
identifier character varying(64),
|
85 |
scope character varying(8)
|
86 |
); |
87 |
|
88 |
|
89 |
ALTER TABLE sitools."USER_PROPERTIES" OWNER TO sitools; |
90 |
|
91 |
--
|
92 |
-- TOC entry 1895 (class 0 OID 16665)
|
93 |
-- Dependencies: 1591
|
94 |
-- Data for Name: GROUPS; Type: TABLE DATA; Schema: sitools; Owner: sitools
|
95 |
--
|
96 |
|
97 |
INSERT INTO "GROUPS" (name, description) VALUES ('register', 'Group of registered? persons'); |
98 |
INSERT INTO "GROUPS" (name, description) VALUES ('administrator', 'Group of persons managing the archive system'); |
99 |
|
100 |
--
|
101 |
-- TOC entry 1896 (class 0 OID 16677)
|
102 |
-- Dependencies: 1592
|
103 |
-- Data for Name: USERS; Type: TABLE DATA; Schema: sitools; Owner: sitools
|
104 |
--
|
105 |
|
106 |
INSERT INTO "USERS" (identifier, firstname, lastname, email, secret) VALUES ('admin', 'firstname', 'lastname', 'admin-sitools@cnes.fr', 'admin'); |
107 |
|
108 |
--
|
109 |
-- TOC entry 1897 (class 0 OID 16680)
|
110 |
-- Dependencies: 1593
|
111 |
-- Data for Name: USER_GROUP; Type: TABLE DATA; Schema: sitools; Owner: sitools
|
112 |
--
|
113 |
|
114 |
INSERT INTO "USER_GROUP" (identifier, name) VALUES ('admin', 'administrator'); |
115 |
|
116 |
|
117 |
--
|
118 |
-- TOC entry 1898 (class 0 OID 16683)
|
119 |
-- Dependencies: 1594
|
120 |
-- Data for Name: USER_PROPERTIES; Type: TABLE DATA; Schema: sitools; Owner: sitools
|
121 |
--
|
122 |
|
123 |
|
124 |
|
125 |
--
|
126 |
-- TOC entry 1887 (class 2606 OID 16714)
|
127 |
-- Dependencies: 1591 1591
|
128 |
-- Name: PK_GROUP; Type: CONSTRAINT; Schema: sitools; Owner: sitools; Tablespace:
|
129 |
--
|
130 |
|
131 |
ALTER TABLE ONLY "GROUPS" |
132 |
ADD CONSTRAINT "PK_GROUP" PRIMARY KEY (name); |
133 |
|
134 |
|
135 |
--
|
136 |
-- TOC entry 1889 (class 2606 OID 16718)
|
137 |
-- Dependencies: 1592 1592
|
138 |
-- Name: PK_USER; Type: CONSTRAINT; Schema: sitools; Owner: sitools; Tablespace:
|
139 |
--
|
140 |
|
141 |
ALTER TABLE ONLY "USERS" |
142 |
ADD CONSTRAINT "PK_USER" PRIMARY KEY (identifier); |
143 |
|
144 |
|
145 |
--
|
146 |
-- TOC entry 1891 (class 2606 OID 16720)
|
147 |
-- Dependencies: 1593 1593 1593
|
148 |
-- Name: USER_GROUP_pkey; Type: CONSTRAINT; Schema: sitools; Owner: sitools; Tablespace:
|
149 |
--
|
150 |
|
151 |
ALTER TABLE ONLY "USER_GROUP" |
152 |
ADD CONSTRAINT "USER_GROUP_pkey" PRIMARY KEY (identifier, name); |
153 |
|
154 |
|
155 |
--
|
156 |
-- TOC entry 1892 (class 1259 OID 16725)
|
157 |
-- Dependencies: 1594 1594
|
158 |
-- Name: IDX_PROPERTIES; Type: INDEX; Schema: sitools; Owner: sitools; Tablespace:
|
159 |
--
|
160 |
|
161 |
CREATE INDEX "IDX_PROPERTIES" ON "USER_PROPERTIES" USING btree (identifier, key); |
162 |
|
163 |
|
164 |
--
|
165 |
-- TOC entry 1893 (class 2606 OID 16726)
|
166 |
-- Dependencies: 1591 1886 1593
|
167 |
-- Name: FK_GROUP; Type: FK CONSTRAINT; Schema: sitools; Owner: sitools
|
168 |
--
|
169 |
|
170 |
ALTER TABLE ONLY "USER_GROUP" |
171 |
ADD CONSTRAINT "FK_GROUP" FOREIGN KEY (name) REFERENCES "GROUPS"(name) ON DELETE CASCADE; |
172 |
|
173 |
|
174 |
--
|
175 |
-- TOC entry 1894 (class 2606 OID 16731)
|
176 |
-- Dependencies: 1593 1592 1888
|
177 |
-- Name: FK_USER; Type: FK CONSTRAINT; Schema: sitools; Owner: sitools
|
178 |
--
|
179 |
|
180 |
ALTER TABLE ONLY "USER_GROUP" |
181 |
ADD CONSTRAINT "FK_USER" FOREIGN KEY (identifier) REFERENCES "USERS"(identifier) ON DELETE CASCADE; |
182 |
|
183 |
|
184 |
--
|
185 |
-- TOC entry 1901 (class 0 OID 0)
|
186 |
-- Dependencies: 8
|
187 |
-- Name: sitools; Type: ACL; Schema: -; Owner: sitools
|
188 |
--
|
189 |
|
190 |
REVOKE ALL ON SCHEMA sitools FROM PUBLIC; |
191 |
REVOKE ALL ON SCHEMA sitools FROM sitools; |
192 |
GRANT ALL ON SCHEMA sitools TO sitools; |
193 |
|
194 |
|
195 |
--
|
196 |
-- TOC entry 1902 (class 0 OID 0)
|
197 |
-- Dependencies: 1591
|
198 |
-- Name: GROUPS; Type: ACL; Schema: sitools; Owner: sitools
|
199 |
--
|
200 |
|
201 |
REVOKE ALL ON TABLE "GROUPS" FROM PUBLIC; |
202 |
REVOKE ALL ON TABLE "GROUPS" FROM sitools; |
203 |
GRANT ALL ON TABLE "GROUPS" TO sitools; |
204 |
GRANT ALL ON TABLE "GROUPS" TO PUBLIC; |
205 |
|
206 |
|
207 |
--
|
208 |
-- TOC entry 1903 (class 0 OID 0)
|
209 |
-- Dependencies: 1592
|
210 |
-- Name: USERS; Type: ACL; Schema: sitools; Owner: sitools
|
211 |
--
|
212 |
|
213 |
REVOKE ALL ON TABLE "USERS" FROM PUBLIC; |
214 |
REVOKE ALL ON TABLE "USERS" FROM sitools; |
215 |
GRANT ALL ON TABLE "USERS" TO sitools; |
216 |
GRANT ALL ON TABLE "USERS" TO PUBLIC; |
217 |
|
218 |
|
219 |
--
|
220 |
-- TOC entry 1904 (class 0 OID 0)
|
221 |
-- Dependencies: 1593
|
222 |
-- Name: USER_GROUP; Type: ACL; Schema: sitools; Owner: sitools
|
223 |
--
|
224 |
|
225 |
REVOKE ALL ON TABLE "USER_GROUP" FROM PUBLIC; |
226 |
REVOKE ALL ON TABLE "USER_GROUP" FROM sitools; |
227 |
GRANT ALL ON TABLE "USER_GROUP" TO sitools; |
228 |
GRANT ALL ON TABLE "USER_GROUP" TO PUBLIC; |
229 |
|
230 |
|
231 |
--
|
232 |
-- TOC entry 1905 (class 0 OID 0)
|
233 |
-- Dependencies: 1594
|
234 |
-- Name: USER_PROPERTIES; Type: ACL; Schema: sitools; Owner: sitools
|
235 |
--
|
236 |
|
237 |
REVOKE ALL ON TABLE "USER_PROPERTIES" FROM PUBLIC; |
238 |
REVOKE ALL ON TABLE "USER_PROPERTIES" FROM sitools; |
239 |
GRANT ALL ON TABLE "USER_PROPERTIES" TO sitools; |
240 |
GRANT ALL ON TABLE "USER_PROPERTIES" TO PUBLIC; |
241 |
|
242 |
|
243 |
-- Completed on 2011-04-13 18:14:28
|
244 |
|
245 |
--
|
246 |
-- PostgreSQL database dump complete
|
247 |
--
|
248 |
|