franta-hg@18
|
1 |
--
|
franta-hg@18
|
2 |
-- PostgreSQL database dump
|
franta-hg@18
|
3 |
--
|
franta-hg@18
|
4 |
|
franta-hg@71
|
5 |
-- Started on 2010-03-16 14:11:16 CET
|
franta-hg@18
|
6 |
|
franta-hg@18
|
7 |
SET statement_timeout = 0;
|
franta-hg@18
|
8 |
SET client_encoding = 'UTF8';
|
franta-hg@18
|
9 |
SET standard_conforming_strings = off;
|
franta-hg@18
|
10 |
SET check_function_bodies = false;
|
franta-hg@18
|
11 |
SET client_min_messages = warning;
|
franta-hg@18
|
12 |
SET escape_string_warning = off;
|
franta-hg@18
|
13 |
|
franta-hg@18
|
14 |
--
|
franta-hg@18
|
15 |
-- TOC entry 10 (class 2615 OID 35015)
|
franta-hg@18
|
16 |
-- Name: nekurak; Type: SCHEMA; Schema: -; Owner: nekurak
|
franta-hg@18
|
17 |
--
|
franta-hg@18
|
18 |
|
franta-hg@18
|
19 |
CREATE SCHEMA nekurak;
|
franta-hg@18
|
20 |
|
franta-hg@18
|
21 |
|
franta-hg@18
|
22 |
ALTER SCHEMA nekurak OWNER TO nekurak;
|
franta-hg@18
|
23 |
|
franta-hg@18
|
24 |
SET search_path = nekurak, pg_catalog;
|
franta-hg@18
|
25 |
|
franta-hg@18
|
26 |
--
|
franta-hg@71
|
27 |
-- TOC entry 368 (class 1247 OID 35086)
|
franta-hg@71
|
28 |
-- Dependencies: 369 10
|
franta-hg@62
|
29 |
-- Name: email; Type: DOMAIN; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
30 |
--
|
franta-hg@62
|
31 |
|
franta-hg@62
|
32 |
CREATE DOMAIN email AS character varying(255)
|
franta-hg@62
|
33 |
CONSTRAINT email_regexp CHECK (((VALUE)::text ~ '^[_a-zA-Z0-9\\.\\-]+@[_a-zA-Z0-9\\.\\-]+\\.[a-zA-Z]{2,4}$'::text));
|
franta-hg@62
|
34 |
|
franta-hg@62
|
35 |
|
franta-hg@62
|
36 |
ALTER DOMAIN nekurak.email OWNER TO nekurak;
|
franta-hg@62
|
37 |
|
franta-hg@62
|
38 |
--
|
franta-hg@71
|
39 |
-- TOC entry 1892 (class 0 OID 0)
|
franta-hg@71
|
40 |
-- Dependencies: 368
|
franta-hg@62
|
41 |
-- Name: DOMAIN email; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
42 |
--
|
franta-hg@62
|
43 |
|
franta-hg@62
|
44 |
COMMENT ON DOMAIN email IS 'e-mailová adresa';
|
franta-hg@62
|
45 |
|
franta-hg@62
|
46 |
|
franta-hg@62
|
47 |
--
|
franta-hg@62
|
48 |
-- TOC entry 65 (class 1255 OID 35124)
|
franta-hg@71
|
49 |
-- Dependencies: 395 10
|
franta-hg@62
|
50 |
-- Name: bezny_uzivatel(); Type: FUNCTION; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
51 |
--
|
franta-hg@62
|
52 |
|
franta-hg@62
|
53 |
CREATE FUNCTION bezny_uzivatel() RETURNS trigger
|
franta-hg@62
|
54 |
LANGUAGE plpgsql
|
franta-hg@62
|
55 |
AS $$BEGIN
|
franta-hg@62
|
56 |
INSERT INTO uzivatel_role
|
franta-hg@62
|
57 |
(role, prezdivka)
|
franta-hg@62
|
58 |
VALUES
|
franta-hg@62
|
59 |
('bezny', new.prezdivka);
|
franta-hg@62
|
60 |
RETURN new;
|
franta-hg@62
|
61 |
END;$$;
|
franta-hg@62
|
62 |
|
franta-hg@62
|
63 |
|
franta-hg@62
|
64 |
ALTER FUNCTION nekurak.bezny_uzivatel() OWNER TO nekurak;
|
franta-hg@62
|
65 |
|
franta-hg@62
|
66 |
--
|
franta-hg@71
|
67 |
-- TOC entry 1893 (class 0 OID 0)
|
franta-hg@62
|
68 |
-- Dependencies: 65
|
franta-hg@62
|
69 |
-- Name: FUNCTION bezny_uzivatel(); Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
70 |
--
|
franta-hg@62
|
71 |
|
franta-hg@62
|
72 |
COMMENT ON FUNCTION bezny_uzivatel() IS 'Každému novému uživateli dáme automaticky roli „bezny“.';
|
franta-hg@62
|
73 |
|
franta-hg@62
|
74 |
|
franta-hg@71
|
75 |
--
|
franta-hg@71
|
76 |
-- TOC entry 1592 (class 1259 OID 35183)
|
franta-hg@71
|
77 |
-- Dependencies: 10
|
franta-hg@71
|
78 |
-- Name: fotka_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
79 |
--
|
franta-hg@71
|
80 |
|
franta-hg@71
|
81 |
CREATE SEQUENCE fotka_seq
|
franta-hg@71
|
82 |
START WITH 1
|
franta-hg@71
|
83 |
INCREMENT BY 1
|
franta-hg@71
|
84 |
NO MAXVALUE
|
franta-hg@71
|
85 |
NO MINVALUE
|
franta-hg@71
|
86 |
CACHE 1;
|
franta-hg@71
|
87 |
|
franta-hg@71
|
88 |
|
franta-hg@71
|
89 |
ALTER TABLE nekurak.fotka_seq OWNER TO nekurak;
|
franta-hg@71
|
90 |
|
franta-hg@62
|
91 |
SET default_tablespace = '';
|
franta-hg@62
|
92 |
|
franta-hg@71
|
93 |
SET default_with_oids = false;
|
franta-hg@71
|
94 |
|
franta-hg@71
|
95 |
--
|
franta-hg@71
|
96 |
-- TOC entry 1593 (class 1259 OID 35185)
|
franta-hg@71
|
97 |
-- Dependencies: 1869 1870 10
|
franta-hg@71
|
98 |
-- Name: fotka; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@71
|
99 |
--
|
franta-hg@71
|
100 |
|
franta-hg@71
|
101 |
CREATE TABLE fotka (
|
franta-hg@71
|
102 |
id integer DEFAULT nextval('fotka_seq'::regclass) NOT NULL,
|
franta-hg@71
|
103 |
podnik integer NOT NULL,
|
franta-hg@71
|
104 |
popis character varying(255),
|
franta-hg@71
|
105 |
poradi integer DEFAULT 0 NOT NULL
|
franta-hg@71
|
106 |
);
|
franta-hg@71
|
107 |
|
franta-hg@71
|
108 |
|
franta-hg@71
|
109 |
ALTER TABLE nekurak.fotka OWNER TO nekurak;
|
franta-hg@71
|
110 |
|
franta-hg@71
|
111 |
--
|
franta-hg@71
|
112 |
-- TOC entry 1895 (class 0 OID 0)
|
franta-hg@71
|
113 |
-- Dependencies: 1593
|
franta-hg@71
|
114 |
-- Name: TABLE fotka; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
115 |
--
|
franta-hg@71
|
116 |
|
franta-hg@71
|
117 |
COMMENT ON TABLE fotka IS 'Fotka podniku.';
|
franta-hg@71
|
118 |
|
franta-hg@71
|
119 |
|
franta-hg@71
|
120 |
--
|
franta-hg@71
|
121 |
-- TOC entry 1896 (class 0 OID 0)
|
franta-hg@71
|
122 |
-- Dependencies: 1593
|
franta-hg@71
|
123 |
-- Name: COLUMN fotka.poradi; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
124 |
--
|
franta-hg@71
|
125 |
|
franta-hg@71
|
126 |
COMMENT ON COLUMN fotka.poradi IS 'Pořadí fotky v rámci daného podniku.';
|
franta-hg@71
|
127 |
|
franta-hg@71
|
128 |
|
franta-hg@62
|
129 |
SET default_with_oids = true;
|
franta-hg@62
|
130 |
|
franta-hg@62
|
131 |
--
|
franta-hg@71
|
132 |
-- TOC entry 1587 (class 1259 OID 35068)
|
franta-hg@71
|
133 |
-- Dependencies: 1866 10
|
franta-hg@62
|
134 |
-- Name: hlasovani; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
135 |
--
|
franta-hg@62
|
136 |
|
franta-hg@62
|
137 |
CREATE TABLE hlasovani (
|
franta-hg@62
|
138 |
podnik integer NOT NULL,
|
franta-hg@62
|
139 |
hlas boolean NOT NULL,
|
franta-hg@62
|
140 |
datum date DEFAULT now() NOT NULL,
|
franta-hg@62
|
141 |
ip_adresa character varying(255)
|
franta-hg@62
|
142 |
);
|
franta-hg@62
|
143 |
|
franta-hg@62
|
144 |
|
franta-hg@62
|
145 |
ALTER TABLE nekurak.hlasovani OWNER TO nekurak;
|
franta-hg@62
|
146 |
|
franta-hg@62
|
147 |
--
|
franta-hg@71
|
148 |
-- TOC entry 1898 (class 0 OID 0)
|
franta-hg@71
|
149 |
-- Dependencies: 1587
|
franta-hg@62
|
150 |
-- Name: COLUMN hlasovani.hlas; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
151 |
--
|
franta-hg@62
|
152 |
|
franta-hg@62
|
153 |
COMMENT ON COLUMN hlasovani.hlas IS 'Má být tento podnik nekuřácký?
|
franta-hg@62
|
154 |
true = nekuřácký
|
franta-hg@62
|
155 |
false = kouření povoleno';
|
franta-hg@62
|
156 |
|
franta-hg@62
|
157 |
|
franta-hg@62
|
158 |
--
|
franta-hg@71
|
159 |
-- TOC entry 1585 (class 1259 OID 35019)
|
franta-hg@18
|
160 |
-- Dependencies: 10
|
franta-hg@18
|
161 |
-- Name: podnik_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
|
franta-hg@18
|
162 |
--
|
franta-hg@18
|
163 |
|
franta-hg@18
|
164 |
CREATE SEQUENCE podnik_seq
|
franta-hg@18
|
165 |
INCREMENT BY 1
|
franta-hg@18
|
166 |
NO MAXVALUE
|
franta-hg@18
|
167 |
NO MINVALUE
|
franta-hg@18
|
168 |
CACHE 1;
|
franta-hg@18
|
169 |
|
franta-hg@18
|
170 |
|
franta-hg@18
|
171 |
ALTER TABLE nekurak.podnik_seq OWNER TO nekurak;
|
franta-hg@18
|
172 |
|
franta-hg@18
|
173 |
SET default_with_oids = false;
|
franta-hg@18
|
174 |
|
franta-hg@18
|
175 |
--
|
franta-hg@71
|
176 |
-- TOC entry 1586 (class 1259 OID 35049)
|
franta-hg@71
|
177 |
-- Dependencies: 1864 1865 10
|
franta-hg@18
|
178 |
-- Name: podnik; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@18
|
179 |
--
|
franta-hg@18
|
180 |
|
franta-hg@18
|
181 |
CREATE TABLE podnik (
|
franta-hg@18
|
182 |
id integer DEFAULT nextval('podnik_seq'::regclass) NOT NULL,
|
franta-hg@18
|
183 |
nazev character varying(255) NOT NULL,
|
franta-hg@62
|
184 |
popis character varying(255),
|
franta-hg@62
|
185 |
url character varying(255),
|
franta-hg@62
|
186 |
datum timestamp with time zone DEFAULT now(),
|
franta-hg@62
|
187 |
ulice character varying(64),
|
franta-hg@62
|
188 |
cislo_popisne integer,
|
franta-hg@71
|
189 |
mesto character varying(64),
|
franta-hg@71
|
190 |
spravce character varying(64)
|
franta-hg@18
|
191 |
);
|
franta-hg@18
|
192 |
|
franta-hg@18
|
193 |
|
franta-hg@18
|
194 |
ALTER TABLE nekurak.podnik OWNER TO nekurak;
|
franta-hg@18
|
195 |
|
franta-hg@18
|
196 |
--
|
franta-hg@71
|
197 |
-- TOC entry 1901 (class 0 OID 0)
|
franta-hg@71
|
198 |
-- Dependencies: 1586
|
franta-hg@71
|
199 |
-- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
200 |
--
|
franta-hg@71
|
201 |
|
franta-hg@71
|
202 |
COMMENT ON COLUMN podnik.spravce IS 'Přezdívka uživatele, který je správcem tohoto podniku (zadal ho do systému nebo správcovství později dostal)';
|
franta-hg@71
|
203 |
|
franta-hg@71
|
204 |
|
franta-hg@71
|
205 |
--
|
franta-hg@71
|
206 |
-- TOC entry 1590 (class 1259 OID 35101)
|
franta-hg@62
|
207 |
-- Dependencies: 10
|
franta-hg@62
|
208 |
-- Name: role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@18
|
209 |
--
|
franta-hg@18
|
210 |
|
franta-hg@62
|
211 |
CREATE TABLE role (
|
franta-hg@62
|
212 |
kod character varying(16) NOT NULL,
|
franta-hg@62
|
213 |
popis character varying(255)
|
franta-hg@62
|
214 |
);
|
franta-hg@18
|
215 |
|
franta-hg@18
|
216 |
|
franta-hg@62
|
217 |
ALTER TABLE nekurak.role OWNER TO nekurak;
|
franta-hg@62
|
218 |
|
franta-hg@18
|
219 |
--
|
franta-hg@71
|
220 |
-- TOC entry 1903 (class 0 OID 0)
|
franta-hg@71
|
221 |
-- Dependencies: 1590
|
franta-hg@62
|
222 |
-- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
223 |
--
|
franta-hg@62
|
224 |
|
franta-hg@62
|
225 |
COMMENT ON TABLE role IS 'Role (skupiny) uživatelů ~ oprávnění';
|
franta-hg@62
|
226 |
|
franta-hg@62
|
227 |
|
franta-hg@62
|
228 |
--
|
franta-hg@71
|
229 |
-- TOC entry 1588 (class 1259 OID 35080)
|
franta-hg@62
|
230 |
-- Dependencies: 10
|
franta-hg@62
|
231 |
-- Name: uzivatel_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
232 |
--
|
franta-hg@62
|
233 |
|
franta-hg@62
|
234 |
CREATE SEQUENCE uzivatel_seq
|
franta-hg@62
|
235 |
INCREMENT BY 1
|
franta-hg@62
|
236 |
NO MAXVALUE
|
franta-hg@62
|
237 |
NO MINVALUE
|
franta-hg@62
|
238 |
CACHE 1;
|
franta-hg@62
|
239 |
|
franta-hg@62
|
240 |
|
franta-hg@62
|
241 |
ALTER TABLE nekurak.uzivatel_seq OWNER TO nekurak;
|
franta-hg@62
|
242 |
|
franta-hg@62
|
243 |
--
|
franta-hg@71
|
244 |
-- TOC entry 1589 (class 1259 OID 35091)
|
franta-hg@71
|
245 |
-- Dependencies: 1867 1868 10
|
franta-hg@62
|
246 |
-- Name: uzivatel; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
247 |
--
|
franta-hg@62
|
248 |
|
franta-hg@62
|
249 |
CREATE TABLE uzivatel (
|
franta-hg@62
|
250 |
id integer DEFAULT nextval('uzivatel_seq'::regclass) NOT NULL,
|
franta-hg@62
|
251 |
prezdivka character varying(64) NOT NULL,
|
franta-hg@62
|
252 |
heslo character varying(512) NOT NULL,
|
franta-hg@62
|
253 |
jmeno character varying(64),
|
franta-hg@62
|
254 |
prijmeni character varying(64),
|
franta-hg@62
|
255 |
email character varying(255),
|
franta-hg@62
|
256 |
datum timestamp with time zone DEFAULT now() NOT NULL
|
franta-hg@62
|
257 |
);
|
franta-hg@62
|
258 |
|
franta-hg@62
|
259 |
|
franta-hg@62
|
260 |
ALTER TABLE nekurak.uzivatel OWNER TO nekurak;
|
franta-hg@62
|
261 |
|
franta-hg@62
|
262 |
--
|
franta-hg@71
|
263 |
-- TOC entry 1906 (class 0 OID 0)
|
franta-hg@71
|
264 |
-- Dependencies: 1589
|
franta-hg@62
|
265 |
-- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
266 |
--
|
franta-hg@62
|
267 |
|
franta-hg@62
|
268 |
COMMENT ON COLUMN uzivatel.prezdivka IS 'Uživatelské jméno';
|
franta-hg@62
|
269 |
|
franta-hg@62
|
270 |
|
franta-hg@62
|
271 |
--
|
franta-hg@71
|
272 |
-- TOC entry 1591 (class 1259 OID 35106)
|
franta-hg@62
|
273 |
-- Dependencies: 10
|
franta-hg@62
|
274 |
-- Name: uzivatel_role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
275 |
--
|
franta-hg@62
|
276 |
|
franta-hg@62
|
277 |
CREATE TABLE uzivatel_role (
|
franta-hg@62
|
278 |
role character varying(16) NOT NULL,
|
franta-hg@62
|
279 |
prezdivka character varying(64) NOT NULL
|
franta-hg@62
|
280 |
);
|
franta-hg@62
|
281 |
|
franta-hg@62
|
282 |
|
franta-hg@62
|
283 |
ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak;
|
franta-hg@62
|
284 |
|
franta-hg@62
|
285 |
--
|
franta-hg@71
|
286 |
-- TOC entry 1908 (class 0 OID 0)
|
franta-hg@71
|
287 |
-- Dependencies: 1591
|
franta-hg@62
|
288 |
-- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
289 |
--
|
franta-hg@62
|
290 |
|
franta-hg@62
|
291 |
COMMENT ON TABLE uzivatel_role IS 'Přiřazení uživatelských rolí (skupin).';
|
franta-hg@62
|
292 |
|
franta-hg@62
|
293 |
|
franta-hg@62
|
294 |
--
|
franta-hg@71
|
295 |
-- TOC entry 1882 (class 2606 OID 35190)
|
franta-hg@71
|
296 |
-- Dependencies: 1593 1593
|
franta-hg@71
|
297 |
-- Name: fotka_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@71
|
298 |
--
|
franta-hg@71
|
299 |
|
franta-hg@71
|
300 |
ALTER TABLE ONLY fotka
|
franta-hg@71
|
301 |
ADD CONSTRAINT fotka_pk PRIMARY KEY (id);
|
franta-hg@71
|
302 |
|
franta-hg@71
|
303 |
|
franta-hg@71
|
304 |
--
|
franta-hg@71
|
305 |
-- TOC entry 1872 (class 2606 OID 35058)
|
franta-hg@71
|
306 |
-- Dependencies: 1586 1586
|
franta-hg@18
|
307 |
-- Name: podnik_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@18
|
308 |
--
|
franta-hg@18
|
309 |
|
franta-hg@18
|
310 |
ALTER TABLE ONLY podnik
|
franta-hg@18
|
311 |
ADD CONSTRAINT podnik_pk PRIMARY KEY (id);
|
franta-hg@18
|
312 |
|
franta-hg@18
|
313 |
|
franta-hg@19
|
314 |
--
|
franta-hg@71
|
315 |
-- TOC entry 1878 (class 2606 OID 35105)
|
franta-hg@71
|
316 |
-- Dependencies: 1590 1590
|
franta-hg@62
|
317 |
-- Name: skupina_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
318 |
--
|
franta-hg@62
|
319 |
|
franta-hg@62
|
320 |
ALTER TABLE ONLY role
|
franta-hg@62
|
321 |
ADD CONSTRAINT skupina_pk PRIMARY KEY (kod);
|
franta-hg@62
|
322 |
|
franta-hg@62
|
323 |
|
franta-hg@62
|
324 |
--
|
franta-hg@71
|
325 |
-- TOC entry 1874 (class 2606 OID 35098)
|
franta-hg@71
|
326 |
-- Dependencies: 1589 1589
|
franta-hg@62
|
327 |
-- Name: uzivatel_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
328 |
--
|
franta-hg@62
|
329 |
|
franta-hg@62
|
330 |
ALTER TABLE ONLY uzivatel
|
franta-hg@62
|
331 |
ADD CONSTRAINT uzivatel_pk PRIMARY KEY (id);
|
franta-hg@62
|
332 |
|
franta-hg@62
|
333 |
|
franta-hg@62
|
334 |
--
|
franta-hg@71
|
335 |
-- TOC entry 1876 (class 2606 OID 35100)
|
franta-hg@71
|
336 |
-- Dependencies: 1589 1589
|
franta-hg@62
|
337 |
-- Name: uzivatel_prezdivka_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
338 |
--
|
franta-hg@62
|
339 |
|
franta-hg@62
|
340 |
ALTER TABLE ONLY uzivatel
|
franta-hg@62
|
341 |
ADD CONSTRAINT uzivatel_prezdivka_uq UNIQUE (prezdivka);
|
franta-hg@62
|
342 |
|
franta-hg@62
|
343 |
|
franta-hg@62
|
344 |
--
|
franta-hg@71
|
345 |
-- TOC entry 1880 (class 2606 OID 35137)
|
franta-hg@71
|
346 |
-- Dependencies: 1591 1591 1591
|
franta-hg@62
|
347 |
-- Name: uzivatel_role_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace:
|
franta-hg@62
|
348 |
--
|
franta-hg@62
|
349 |
|
franta-hg@62
|
350 |
ALTER TABLE ONLY uzivatel_role
|
franta-hg@62
|
351 |
ADD CONSTRAINT uzivatel_role_pk PRIMARY KEY (role, prezdivka);
|
franta-hg@62
|
352 |
|
franta-hg@62
|
353 |
|
franta-hg@62
|
354 |
--
|
franta-hg@71
|
355 |
-- TOC entry 1888 (class 2620 OID 35125)
|
franta-hg@71
|
356 |
-- Dependencies: 65 1589
|
franta-hg@62
|
357 |
-- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
358 |
--
|
franta-hg@62
|
359 |
|
franta-hg@62
|
360 |
CREATE TRIGGER uzivatel_insert
|
franta-hg@62
|
361 |
AFTER INSERT ON uzivatel
|
franta-hg@62
|
362 |
FOR EACH ROW
|
franta-hg@62
|
363 |
EXECUTE PROCEDURE bezny_uzivatel();
|
franta-hg@62
|
364 |
|
franta-hg@62
|
365 |
|
franta-hg@62
|
366 |
--
|
franta-hg@71
|
367 |
-- TOC entry 1887 (class 2606 OID 35191)
|
franta-hg@71
|
368 |
-- Dependencies: 1871 1593 1586
|
franta-hg@71
|
369 |
-- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
370 |
--
|
franta-hg@71
|
371 |
|
franta-hg@71
|
372 |
ALTER TABLE ONLY fotka
|
franta-hg@71
|
373 |
ADD CONSTRAINT fotka_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
|
franta-hg@71
|
374 |
|
franta-hg@71
|
375 |
|
franta-hg@71
|
376 |
--
|
franta-hg@71
|
377 |
-- TOC entry 1884 (class 2606 OID 35072)
|
franta-hg@71
|
378 |
-- Dependencies: 1871 1586 1587
|
franta-hg@62
|
379 |
-- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
380 |
--
|
franta-hg@62
|
381 |
|
franta-hg@62
|
382 |
ALTER TABLE ONLY hlasovani
|
franta-hg@62
|
383 |
ADD CONSTRAINT hlasovani_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
|
franta-hg@62
|
384 |
|
franta-hg@62
|
385 |
|
franta-hg@62
|
386 |
--
|
franta-hg@71
|
387 |
-- TOC entry 1883 (class 2606 OID 35178)
|
franta-hg@71
|
388 |
-- Dependencies: 1875 1589 1586
|
franta-hg@71
|
389 |
-- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
390 |
--
|
franta-hg@71
|
391 |
|
franta-hg@71
|
392 |
ALTER TABLE ONLY podnik
|
franta-hg@71
|
393 |
ADD CONSTRAINT podnik_uzivatel_fk FOREIGN KEY (spravce) REFERENCES uzivatel(prezdivka) ON DELETE SET NULL;
|
franta-hg@71
|
394 |
|
franta-hg@71
|
395 |
|
franta-hg@71
|
396 |
--
|
franta-hg@71
|
397 |
-- TOC entry 1885 (class 2606 OID 35138)
|
franta-hg@71
|
398 |
-- Dependencies: 1590 1591 1877
|
franta-hg@62
|
399 |
-- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
400 |
--
|
franta-hg@62
|
401 |
|
franta-hg@62
|
402 |
ALTER TABLE ONLY uzivatel_role
|
franta-hg@62
|
403 |
ADD CONSTRAINT uzivatel_role_role_fk FOREIGN KEY (role) REFERENCES role(kod) ON UPDATE CASCADE ON DELETE CASCADE;
|
franta-hg@62
|
404 |
|
franta-hg@62
|
405 |
|
franta-hg@62
|
406 |
--
|
franta-hg@71
|
407 |
-- TOC entry 1886 (class 2606 OID 35143)
|
franta-hg@71
|
408 |
-- Dependencies: 1591 1589 1875
|
franta-hg@62
|
409 |
-- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
410 |
--
|
franta-hg@62
|
411 |
|
franta-hg@62
|
412 |
ALTER TABLE ONLY uzivatel_role
|
franta-hg@62
|
413 |
ADD CONSTRAINT uzivatel_role_uzivatel_fk FOREIGN KEY (prezdivka) REFERENCES uzivatel(prezdivka) ON UPDATE CASCADE ON DELETE CASCADE;
|
franta-hg@62
|
414 |
|
franta-hg@62
|
415 |
|
franta-hg@62
|
416 |
--
|
franta-hg@71
|
417 |
-- TOC entry 1891 (class 0 OID 0)
|
franta-hg@19
|
418 |
-- Dependencies: 10
|
franta-hg@19
|
419 |
-- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak
|
franta-hg@19
|
420 |
--
|
franta-hg@19
|
421 |
|
franta-hg@19
|
422 |
REVOKE ALL ON SCHEMA nekurak FROM PUBLIC;
|
franta-hg@19
|
423 |
REVOKE ALL ON SCHEMA nekurak FROM nekurak;
|
franta-hg@19
|
424 |
GRANT ALL ON SCHEMA nekurak TO nekurak;
|
franta-hg@19
|
425 |
GRANT USAGE ON SCHEMA nekurak TO nekurak_web;
|
franta-hg@19
|
426 |
|
franta-hg@19
|
427 |
|
franta-hg@19
|
428 |
--
|
franta-hg@71
|
429 |
-- TOC entry 1894 (class 0 OID 0)
|
franta-hg@71
|
430 |
-- Dependencies: 1592
|
franta-hg@71
|
431 |
-- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
432 |
--
|
franta-hg@71
|
433 |
|
franta-hg@71
|
434 |
REVOKE ALL ON SEQUENCE fotka_seq FROM PUBLIC;
|
franta-hg@71
|
435 |
REVOKE ALL ON SEQUENCE fotka_seq FROM nekurak;
|
franta-hg@71
|
436 |
GRANT ALL ON SEQUENCE fotka_seq TO nekurak;
|
franta-hg@71
|
437 |
GRANT USAGE ON SEQUENCE fotka_seq TO nekurak_web;
|
franta-hg@71
|
438 |
|
franta-hg@71
|
439 |
|
franta-hg@71
|
440 |
--
|
franta-hg@71
|
441 |
-- TOC entry 1897 (class 0 OID 0)
|
franta-hg@71
|
442 |
-- Dependencies: 1593
|
franta-hg@71
|
443 |
-- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@71
|
444 |
--
|
franta-hg@71
|
445 |
|
franta-hg@71
|
446 |
REVOKE ALL ON TABLE fotka FROM PUBLIC;
|
franta-hg@71
|
447 |
REVOKE ALL ON TABLE fotka FROM nekurak;
|
franta-hg@71
|
448 |
GRANT ALL ON TABLE fotka TO nekurak;
|
franta-hg@71
|
449 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE fotka TO nekurak_web;
|
franta-hg@71
|
450 |
|
franta-hg@71
|
451 |
|
franta-hg@71
|
452 |
--
|
franta-hg@71
|
453 |
-- TOC entry 1899 (class 0 OID 0)
|
franta-hg@71
|
454 |
-- Dependencies: 1587
|
franta-hg@62
|
455 |
-- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
456 |
--
|
franta-hg@62
|
457 |
|
franta-hg@62
|
458 |
REVOKE ALL ON TABLE hlasovani FROM PUBLIC;
|
franta-hg@62
|
459 |
REVOKE ALL ON TABLE hlasovani FROM nekurak;
|
franta-hg@62
|
460 |
GRANT ALL ON TABLE hlasovani TO nekurak;
|
franta-hg@62
|
461 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hlasovani TO nekurak_web;
|
franta-hg@62
|
462 |
|
franta-hg@62
|
463 |
|
franta-hg@62
|
464 |
--
|
franta-hg@71
|
465 |
-- TOC entry 1900 (class 0 OID 0)
|
franta-hg@71
|
466 |
-- Dependencies: 1585
|
franta-hg@19
|
467 |
-- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@19
|
468 |
--
|
franta-hg@19
|
469 |
|
franta-hg@19
|
470 |
REVOKE ALL ON SEQUENCE podnik_seq FROM PUBLIC;
|
franta-hg@19
|
471 |
REVOKE ALL ON SEQUENCE podnik_seq FROM nekurak;
|
franta-hg@19
|
472 |
GRANT ALL ON SEQUENCE podnik_seq TO nekurak;
|
franta-hg@19
|
473 |
GRANT USAGE ON SEQUENCE podnik_seq TO nekurak_web;
|
franta-hg@19
|
474 |
|
franta-hg@19
|
475 |
|
franta-hg@19
|
476 |
--
|
franta-hg@71
|
477 |
-- TOC entry 1902 (class 0 OID 0)
|
franta-hg@71
|
478 |
-- Dependencies: 1586
|
franta-hg@19
|
479 |
-- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@19
|
480 |
--
|
franta-hg@19
|
481 |
|
franta-hg@19
|
482 |
REVOKE ALL ON TABLE podnik FROM PUBLIC;
|
franta-hg@19
|
483 |
REVOKE ALL ON TABLE podnik FROM nekurak;
|
franta-hg@19
|
484 |
GRANT ALL ON TABLE podnik TO nekurak;
|
franta-hg@19
|
485 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE podnik TO nekurak_web;
|
franta-hg@19
|
486 |
|
franta-hg@19
|
487 |
|
franta-hg@62
|
488 |
--
|
franta-hg@71
|
489 |
-- TOC entry 1904 (class 0 OID 0)
|
franta-hg@71
|
490 |
-- Dependencies: 1590
|
franta-hg@62
|
491 |
-- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
492 |
--
|
franta-hg@62
|
493 |
|
franta-hg@62
|
494 |
REVOKE ALL ON TABLE role FROM PUBLIC;
|
franta-hg@62
|
495 |
REVOKE ALL ON TABLE role FROM nekurak;
|
franta-hg@62
|
496 |
GRANT ALL ON TABLE role TO nekurak;
|
franta-hg@62
|
497 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE role TO nekurak_web;
|
franta-hg@62
|
498 |
|
franta-hg@62
|
499 |
|
franta-hg@62
|
500 |
--
|
franta-hg@71
|
501 |
-- TOC entry 1905 (class 0 OID 0)
|
franta-hg@71
|
502 |
-- Dependencies: 1588
|
franta-hg@62
|
503 |
-- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
504 |
--
|
franta-hg@62
|
505 |
|
franta-hg@62
|
506 |
REVOKE ALL ON SEQUENCE uzivatel_seq FROM PUBLIC;
|
franta-hg@62
|
507 |
REVOKE ALL ON SEQUENCE uzivatel_seq FROM nekurak;
|
franta-hg@62
|
508 |
GRANT ALL ON SEQUENCE uzivatel_seq TO nekurak;
|
franta-hg@62
|
509 |
GRANT USAGE ON SEQUENCE uzivatel_seq TO nekurak_web;
|
franta-hg@62
|
510 |
|
franta-hg@62
|
511 |
|
franta-hg@62
|
512 |
--
|
franta-hg@71
|
513 |
-- TOC entry 1907 (class 0 OID 0)
|
franta-hg@71
|
514 |
-- Dependencies: 1589
|
franta-hg@62
|
515 |
-- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
516 |
--
|
franta-hg@62
|
517 |
|
franta-hg@62
|
518 |
REVOKE ALL ON TABLE uzivatel FROM PUBLIC;
|
franta-hg@62
|
519 |
REVOKE ALL ON TABLE uzivatel FROM nekurak;
|
franta-hg@62
|
520 |
GRANT ALL ON TABLE uzivatel TO nekurak;
|
franta-hg@62
|
521 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel TO nekurak_web;
|
franta-hg@62
|
522 |
|
franta-hg@62
|
523 |
|
franta-hg@62
|
524 |
--
|
franta-hg@71
|
525 |
-- TOC entry 1909 (class 0 OID 0)
|
franta-hg@71
|
526 |
-- Dependencies: 1591
|
franta-hg@62
|
527 |
-- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak
|
franta-hg@62
|
528 |
--
|
franta-hg@62
|
529 |
|
franta-hg@62
|
530 |
REVOKE ALL ON TABLE uzivatel_role FROM PUBLIC;
|
franta-hg@62
|
531 |
REVOKE ALL ON TABLE uzivatel_role FROM nekurak;
|
franta-hg@62
|
532 |
GRANT ALL ON TABLE uzivatel_role TO nekurak;
|
franta-hg@62
|
533 |
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web;
|
franta-hg@62
|
534 |
|
franta-hg@62
|
535 |
|
franta-hg@71
|
536 |
-- Completed on 2010-03-16 14:11:18 CET
|
franta-hg@18
|
537 |
|
franta-hg@18
|
538 |
--
|
franta-hg@18
|
539 |
-- PostgreSQL database dump complete
|
franta-hg@18
|
540 |
--
|
franta-hg@18
|
541 |
|