vigiboard / bdd_vigiboard_schema.sql @ c49defb8
History | View | Annotate | Download (22 KB)
1 | 2ba99120 | Thomas ANDREJAK | --
|
---|---|---|---|
2 | -- PostgreSQL database dump
|
||
3 | --
|
||
4 | |||
5 | e0b69bf9 | Gabriel DE PERTHUIS | SET client_encoding = 'UTF8'; |
6 | 2ba99120 | Thomas ANDREJAK | SET standard_conforming_strings = off;
|
7 | SET check_function_bodies = false; |
||
8 | SET client_min_messages = warning;
|
||
9 | SET escape_string_warning = off;
|
||
10 | |||
11 | SET search_path = public, pg_catalog;
|
||
12 | |||
13 | SET default_tablespace = ''; |
||
14 | |||
15 | SET default_with_oids = false; |
||
16 | |||
17 | --
|
||
18 | -- Name: event_history; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
19 | --
|
||
20 | |||
21 | CREATE TABLE event_history ( |
||
22 | idhistory integer NOT NULL, |
||
23 | type_action character varying(27) NOT NULL, |
||
24 | idevent integer NOT NULL, |
||
25 | e0b69bf9 | Gabriel DE PERTHUIS | value text,
|
26 | 2ba99120 | Thomas ANDREJAK | text text, |
27 | "timestamp" timestamp without time zone, |
||
28 | e0b69bf9 | Gabriel DE PERTHUIS | username text
|
29 | 2ba99120 | Thomas ANDREJAK | ); |
30 | |||
31 | |||
32 | ALTER TABLE public.event_history OWNER TO vigiboard; |
||
33 | |||
34 | --
|
||
35 | -- Name: event_history_idhistory_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
36 | --
|
||
37 | |||
38 | CREATE SEQUENCE event_history_idhistory_seq
|
||
39 | 1ebe6c7c | Thomas ANDREJAK | START WITH 1
|
40 | 2ba99120 | Thomas ANDREJAK | INCREMENT BY 1 |
41 | NO MAXVALUE |
||
42 | NO MINVALUE |
||
43 | CACHE 1;
|
||
44 | |||
45 | |||
46 | ALTER TABLE public.event_history_idhistory_seq OWNER TO vigiboard; |
||
47 | |||
48 | --
|
||
49 | -- Name: event_history_idhistory_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
50 | --
|
||
51 | |||
52 | ALTER SEQUENCE event_history_idhistory_seq OWNED BY event_history.idhistory; |
||
53 | |||
54 | |||
55 | --
|
||
56 | -- Name: events; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
57 | --
|
||
58 | |||
59 | CREATE TABLE events ( |
||
60 | idevent integer NOT NULL, |
||
61 | e0b69bf9 | Gabriel DE PERTHUIS | hostname text NOT NULL, |
62 | servicename text,
|
||
63 | 2ba99120 | Thomas ANDREJAK | severity integer NOT NULL, |
64 | status character varying(12) DEFAULT 'None'::character varying NOT NULL, |
||
65 | active boolean,
|
||
66 | "timestamp" timestamp without time zone, |
||
67 | output text NOT NULL, |
||
68 | timestamp_active timestamp without time zone, |
||
69 | e0b69bf9 | Gabriel DE PERTHUIS | trouble_ticket text,
|
70 | 2ba99120 | Thomas ANDREJAK | occurence integer,
|
71 | impact integer,
|
||
72 | 1ebe6c7c | Thomas ANDREJAK | rawstate character varying(8)
|
73 | 2ba99120 | Thomas ANDREJAK | ); |
74 | |||
75 | |||
76 | ALTER TABLE public.events OWNER TO vigiboard; |
||
77 | |||
78 | --
|
||
79 | -- Name: events_idevent_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
80 | --
|
||
81 | |||
82 | CREATE SEQUENCE events_idevent_seq
|
||
83 | 1ebe6c7c | Thomas ANDREJAK | START WITH 1
|
84 | 2ba99120 | Thomas ANDREJAK | INCREMENT BY 1 |
85 | NO MAXVALUE |
||
86 | NO MINVALUE |
||
87 | CACHE 1;
|
||
88 | |||
89 | |||
90 | ALTER TABLE public.events_idevent_seq OWNER TO vigiboard; |
||
91 | |||
92 | --
|
||
93 | -- Name: events_idevent_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
94 | --
|
||
95 | |||
96 | ALTER SEQUENCE events_idevent_seq OWNED BY events.idevent; |
||
97 | |||
98 | |||
99 | --
|
||
100 | -- Name: graph; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
101 | --
|
||
102 | |||
103 | CREATE TABLE graph ( |
||
104 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
105 | template text NOT NULL, |
||
106 | vlabel text NOT NULL |
||
107 | 2ba99120 | Thomas ANDREJAK | ); |
108 | |||
109 | |||
110 | ALTER TABLE public.graph OWNER TO vigiboard; |
||
111 | |||
112 | --
|
||
113 | -- Name: graphgroups; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
114 | --
|
||
115 | |||
116 | CREATE TABLE graphgroups ( |
||
117 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
118 | 2ba99120 | Thomas ANDREJAK | parent integer
|
119 | ); |
||
120 | |||
121 | |||
122 | ALTER TABLE public.graphgroups OWNER TO vigiboard; |
||
123 | |||
124 | --
|
||
125 | -- Name: graphtogroups; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
126 | --
|
||
127 | |||
128 | CREATE TABLE graphtogroups ( |
||
129 | e0b69bf9 | Gabriel DE PERTHUIS | graphname text NOT NULL, |
130 | groupname text NOT NULL |
||
131 | 2ba99120 | Thomas ANDREJAK | ); |
132 | |||
133 | |||
134 | ALTER TABLE public.graphtogroups OWNER TO vigiboard; |
||
135 | |||
136 | --
|
||
137 | -- Name: grouppermissions; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
138 | --
|
||
139 | |||
140 | CREATE TABLE grouppermissions ( |
||
141 | e0b69bf9 | Gabriel DE PERTHUIS | groupname text NOT NULL, |
142 | 2ba99120 | Thomas ANDREJAK | idpermission integer NOT NULL |
143 | ); |
||
144 | |||
145 | |||
146 | ALTER TABLE public.grouppermissions OWNER TO vigiboard; |
||
147 | |||
148 | --
|
||
149 | -- Name: groups; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
150 | --
|
||
151 | |||
152 | CREATE TABLE groups ( |
||
153 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
154 | parent text
|
||
155 | 2ba99120 | Thomas ANDREJAK | ); |
156 | |||
157 | |||
158 | ALTER TABLE public.groups OWNER TO vigiboard; |
||
159 | |||
160 | --
|
||
161 | -- Name: host; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
162 | --
|
||
163 | |||
164 | CREATE TABLE host ( |
||
165 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
166 | checkhostcmd text NOT NULL, |
||
167 | community text NOT NULL, |
||
168 | fqhn text NOT NULL, |
||
169 | hosttpl text NOT NULL, |
||
170 | mainip text NOT NULL, |
||
171 | 2ba99120 | Thomas ANDREJAK | port integer NOT NULL, |
172 | snmpoidsperpdu integer,
|
||
173 | e0b69bf9 | Gabriel DE PERTHUIS | snmpversion text
|
174 | 2ba99120 | Thomas ANDREJAK | ); |
175 | |||
176 | |||
177 | ALTER TABLE public.host OWNER TO vigiboard; |
||
178 | |||
179 | --
|
||
180 | -- Name: hostgroups; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
181 | --
|
||
182 | |||
183 | CREATE TABLE hostgroups ( |
||
184 | e0b69bf9 | Gabriel DE PERTHUIS | hostname text NOT NULL, |
185 | groupname text NOT NULL |
||
186 | 2ba99120 | Thomas ANDREJAK | ); |
187 | |||
188 | |||
189 | ALTER TABLE public.hostgroups OWNER TO vigiboard; |
||
190 | |||
191 | --
|
||
192 | -- Name: perfdatasource; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
193 | --
|
||
194 | |||
195 | CREATE TABLE perfdatasource ( |
||
196 | e0b69bf9 | Gabriel DE PERTHUIS | hostname text NOT NULL, |
197 | servicename text NOT NULL, |
||
198 | graphname text NOT NULL, |
||
199 | type text NOT NULL, |
||
200 | label text,
|
||
201 | 2ba99120 | Thomas ANDREJAK | factor double precision NOT NULL |
202 | ); |
||
203 | |||
204 | |||
205 | ALTER TABLE public.perfdatasource OWNER TO vigiboard; |
||
206 | |||
207 | --
|
||
208 | -- Name: service; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
209 | --
|
||
210 | |||
211 | CREATE TABLE service ( |
||
212 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
213 | type text NOT NULL, |
||
214 | command text NOT NULL |
||
215 | 2ba99120 | Thomas ANDREJAK | ); |
216 | |||
217 | |||
218 | ALTER TABLE public.service OWNER TO vigiboard; |
||
219 | |||
220 | --
|
||
221 | -- Name: servicegroups; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
222 | --
|
||
223 | |||
224 | CREATE TABLE servicegroups ( |
||
225 | e0b69bf9 | Gabriel DE PERTHUIS | servicename text NOT NULL, |
226 | groupname text NOT NULL |
||
227 | 2ba99120 | Thomas ANDREJAK | ); |
228 | |||
229 | |||
230 | ALTER TABLE public.servicegroups OWNER TO vigiboard; |
||
231 | |||
232 | --
|
||
233 | -- Name: servicehautniveau; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
234 | --
|
||
235 | |||
236 | CREATE TABLE servicehautniveau ( |
||
237 | e0b69bf9 | Gabriel DE PERTHUIS | servicename text NOT NULL, |
238 | servicename_dep text NOT NULL |
||
239 | 2ba99120 | Thomas ANDREJAK | ); |
240 | |||
241 | |||
242 | ALTER TABLE public.servicehautniveau OWNER TO vigiboard; |
||
243 | |||
244 | --
|
||
245 | -- Name: servicetopo; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
246 | --
|
||
247 | |||
248 | CREATE TABLE servicetopo ( |
||
249 | e0b69bf9 | Gabriel DE PERTHUIS | servicename text NOT NULL, |
250 | function text NOT NULL |
||
251 | 2ba99120 | Thomas ANDREJAK | ); |
252 | |||
253 | |||
254 | ALTER TABLE public.servicetopo OWNER TO vigiboard; |
||
255 | |||
256 | --
|
||
257 | -- Name: state; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
258 | --
|
||
259 | |||
260 | CREATE TABLE state ( |
||
261 | idstat integer NOT NULL, |
||
262 | e0b69bf9 | Gabriel DE PERTHUIS | hostname text NOT NULL, |
263 | servicename text,
|
||
264 | ip text,
|
||
265 | 2ba99120 | Thomas ANDREJAK | "timestamp" timestamp without time zone, |
266 | statename character varying(8) DEFAULT 'OK'::character varying NOT NULL, |
||
267 | type character varying(4) DEFAULT 'SOFT'::character varying NOT NULL, |
||
268 | attempt integer NOT NULL, |
||
269 | message text
|
||
270 | ); |
||
271 | |||
272 | |||
273 | ALTER TABLE public.state OWNER TO vigiboard; |
||
274 | |||
275 | --
|
||
276 | -- Name: state_idstat_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
277 | --
|
||
278 | |||
279 | CREATE SEQUENCE state_idstat_seq
|
||
280 | 1ebe6c7c | Thomas ANDREJAK | START WITH 1
|
281 | 2ba99120 | Thomas ANDREJAK | INCREMENT BY 1 |
282 | NO MAXVALUE |
||
283 | NO MINVALUE |
||
284 | CACHE 1;
|
||
285 | |||
286 | |||
287 | ALTER TABLE public.state_idstat_seq OWNER TO vigiboard; |
||
288 | |||
289 | --
|
||
290 | -- Name: state_idstat_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
291 | --
|
||
292 | |||
293 | ALTER SEQUENCE state_idstat_seq OWNED BY state.idstat; |
||
294 | |||
295 | |||
296 | --
|
||
297 | -- Name: tg_group; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
298 | --
|
||
299 | |||
300 | CREATE TABLE tg_group ( |
||
301 | group_id integer NOT NULL, |
||
302 | group_name character varying(16) NOT NULL, |
||
303 | display_name character varying(255),
|
||
304 | created timestamp without time zone |
||
305 | ); |
||
306 | |||
307 | |||
308 | ALTER TABLE public.tg_group OWNER TO vigiboard; |
||
309 | |||
310 | --
|
||
311 | -- Name: tg_group_group_id_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
312 | --
|
||
313 | |||
314 | CREATE SEQUENCE tg_group_group_id_seq
|
||
315 | INCREMENT BY 1 |
||
316 | NO MAXVALUE |
||
317 | NO MINVALUE |
||
318 | CACHE 1;
|
||
319 | |||
320 | |||
321 | ALTER TABLE public.tg_group_group_id_seq OWNER TO vigiboard; |
||
322 | |||
323 | --
|
||
324 | -- Name: tg_group_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
325 | --
|
||
326 | |||
327 | ALTER SEQUENCE tg_group_group_id_seq OWNED BY tg_group.group_id; |
||
328 | |||
329 | |||
330 | --
|
||
331 | -- Name: tg_group_permission; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
332 | --
|
||
333 | |||
334 | CREATE TABLE tg_group_permission ( |
||
335 | group_id integer,
|
||
336 | permission_id integer
|
||
337 | ); |
||
338 | |||
339 | |||
340 | ALTER TABLE public.tg_group_permission OWNER TO vigiboard; |
||
341 | |||
342 | --
|
||
343 | -- Name: tg_permission; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
344 | --
|
||
345 | |||
346 | CREATE TABLE tg_permission ( |
||
347 | permission_id integer NOT NULL, |
||
348 | permission_name character varying(16) NOT NULL, |
||
349 | description character varying(255)
|
||
350 | ); |
||
351 | |||
352 | |||
353 | ALTER TABLE public.tg_permission OWNER TO vigiboard; |
||
354 | |||
355 | --
|
||
356 | -- Name: tg_permission_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
357 | --
|
||
358 | |||
359 | CREATE SEQUENCE tg_permission_permission_id_seq
|
||
360 | INCREMENT BY 1 |
||
361 | NO MAXVALUE |
||
362 | NO MINVALUE |
||
363 | CACHE 1;
|
||
364 | |||
365 | |||
366 | ALTER TABLE public.tg_permission_permission_id_seq OWNER TO vigiboard; |
||
367 | |||
368 | --
|
||
369 | -- Name: tg_permission_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
370 | --
|
||
371 | |||
372 | ALTER SEQUENCE tg_permission_permission_id_seq OWNED BY tg_permission.permission_id; |
||
373 | |||
374 | |||
375 | --
|
||
376 | -- Name: tg_user; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
377 | --
|
||
378 | |||
379 | CREATE TABLE tg_user ( |
||
380 | user_id integer NOT NULL, |
||
381 | user_name character varying(16) NOT NULL, |
||
382 | email_address character varying(255) NOT NULL, |
||
383 | display_name character varying(255),
|
||
384 | password character varying(80),
|
||
385 | created timestamp without time zone |
||
386 | ); |
||
387 | |||
388 | |||
389 | ALTER TABLE public.tg_user OWNER TO vigiboard; |
||
390 | |||
391 | --
|
||
392 | -- Name: tg_user_group; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
393 | --
|
||
394 | |||
395 | CREATE TABLE tg_user_group ( |
||
396 | user_id integer,
|
||
397 | group_id integer
|
||
398 | ); |
||
399 | |||
400 | |||
401 | ALTER TABLE public.tg_user_group OWNER TO vigiboard; |
||
402 | |||
403 | --
|
||
404 | -- Name: tg_user_user_id_seq; Type: SEQUENCE; Schema: public; Owner: vigiboard
|
||
405 | --
|
||
406 | |||
407 | CREATE SEQUENCE tg_user_user_id_seq
|
||
408 | INCREMENT BY 1 |
||
409 | NO MAXVALUE |
||
410 | NO MINVALUE |
||
411 | CACHE 1;
|
||
412 | |||
413 | |||
414 | ALTER TABLE public.tg_user_user_id_seq OWNER TO vigiboard; |
||
415 | |||
416 | --
|
||
417 | -- Name: tg_user_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: vigiboard
|
||
418 | --
|
||
419 | |||
420 | ALTER SEQUENCE tg_user_user_id_seq OWNED BY tg_user.user_id; |
||
421 | |||
422 | |||
423 | --
|
||
424 | -- Name: version; Type: TABLE; Schema: public; Owner: vigiboard; Tablespace:
|
||
425 | --
|
||
426 | |||
427 | CREATE TABLE version ( |
||
428 | e0b69bf9 | Gabriel DE PERTHUIS | name text NOT NULL, |
429 | version text NOT NULL |
||
430 | 2ba99120 | Thomas ANDREJAK | ); |
431 | |||
432 | |||
433 | ALTER TABLE public.version OWNER TO vigiboard; |
||
434 | |||
435 | --
|
||
436 | -- Name: idhistory; Type: DEFAULT; Schema: public; Owner: vigiboard
|
||
437 | --
|
||
438 | |||
439 | ALTER TABLE event_history ALTER COLUMN idhistory SET DEFAULT nextval('event_history_idhistory_seq'::regclass); |
||
440 | |||
441 | |||
442 | --
|
||
443 | -- Name: idevent; Type: DEFAULT; Schema: public; Owner: vigiboard
|
||
444 | --
|
||
445 | |||
446 | ALTER TABLE events ALTER COLUMN idevent SET DEFAULT nextval('events_idevent_seq'::regclass); |
||
447 | |||
448 | |||
449 | --
|
||
450 | 1ebe6c7c | Thomas ANDREJAK | -- Name: idstat; Type: DEFAULT; Schema: public; Owner: vigiboard
|
451 | --
|
||
452 | |||
453 | ALTER TABLE state ALTER COLUMN idstat SET DEFAULT nextval('state_idstat_seq'::regclass); |
||
454 | |||
455 | |||
456 | --
|
||
457 | 2ba99120 | Thomas ANDREJAK | -- Name: group_id; Type: DEFAULT; Schema: public; Owner: vigiboard
|
458 | --
|
||
459 | |||
460 | ALTER TABLE tg_group ALTER COLUMN group_id SET DEFAULT nextval('tg_group_group_id_seq'::regclass); |
||
461 | |||
462 | |||
463 | --
|
||
464 | -- Name: permission_id; Type: DEFAULT; Schema: public; Owner: vigiboard
|
||
465 | --
|
||
466 | |||
467 | ALTER TABLE tg_permission ALTER COLUMN permission_id SET DEFAULT nextval('tg_permission_permission_id_seq'::regclass); |
||
468 | |||
469 | |||
470 | --
|
||
471 | -- Name: user_id; Type: DEFAULT; Schema: public; Owner: vigiboard
|
||
472 | --
|
||
473 | |||
474 | ALTER TABLE tg_user ALTER COLUMN user_id SET DEFAULT nextval('tg_user_user_id_seq'::regclass); |
||
475 | |||
476 | |||
477 | --
|
||
478 | -- Name: event_history_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
479 | --
|
||
480 | |||
481 | ALTER TABLE ONLY event_history |
||
482 | ADD CONSTRAINT event_history_pkey PRIMARY KEY (idhistory); |
||
483 | |||
484 | |||
485 | --
|
||
486 | -- Name: events_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
487 | --
|
||
488 | |||
489 | ALTER TABLE ONLY events |
||
490 | ADD CONSTRAINT events_pkey PRIMARY KEY (idevent); |
||
491 | |||
492 | |||
493 | --
|
||
494 | -- Name: graph_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
495 | --
|
||
496 | |||
497 | ALTER TABLE ONLY graph |
||
498 | ADD CONSTRAINT graph_pkey PRIMARY KEY (name); |
||
499 | |||
500 | |||
501 | --
|
||
502 | -- Name: graphgroups_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
503 | --
|
||
504 | |||
505 | ALTER TABLE ONLY graphgroups |
||
506 | ADD CONSTRAINT graphgroups_pkey PRIMARY KEY (name); |
||
507 | |||
508 | |||
509 | --
|
||
510 | -- Name: graphtogroups_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
511 | --
|
||
512 | |||
513 | ALTER TABLE ONLY graphtogroups |
||
514 | ADD CONSTRAINT graphtogroups_pkey PRIMARY KEY (graphname, groupname); |
||
515 | |||
516 | |||
517 | --
|
||
518 | -- Name: grouppermissions_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
519 | --
|
||
520 | |||
521 | ALTER TABLE ONLY grouppermissions |
||
522 | ADD CONSTRAINT grouppermissions_pkey PRIMARY KEY (groupname, idpermission); |
||
523 | |||
524 | |||
525 | --
|
||
526 | -- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
527 | --
|
||
528 | |||
529 | ALTER TABLE ONLY groups |
||
530 | ADD CONSTRAINT groups_pkey PRIMARY KEY (name); |
||
531 | |||
532 | |||
533 | --
|
||
534 | -- Name: host_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
535 | --
|
||
536 | |||
537 | ALTER TABLE ONLY host |
||
538 | ADD CONSTRAINT host_pkey PRIMARY KEY (name); |
||
539 | |||
540 | |||
541 | --
|
||
542 | -- Name: hostgroups_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
543 | --
|
||
544 | |||
545 | ALTER TABLE ONLY hostgroups |
||
546 | ADD CONSTRAINT hostgroups_pkey PRIMARY KEY (hostname, groupname); |
||
547 | |||
548 | |||
549 | --
|
||
550 | -- Name: perfdatasource_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
551 | --
|
||
552 | |||
553 | ALTER TABLE ONLY perfdatasource |
||
554 | ADD CONSTRAINT perfdatasource_pkey PRIMARY KEY (hostname, servicename); |
||
555 | |||
556 | |||
557 | --
|
||
558 | -- Name: service_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
559 | --
|
||
560 | |||
561 | ALTER TABLE ONLY service |
||
562 | ADD CONSTRAINT service_pkey PRIMARY KEY (name); |
||
563 | |||
564 | |||
565 | --
|
||
566 | -- Name: servicegroups_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
567 | --
|
||
568 | |||
569 | ALTER TABLE ONLY servicegroups |
||
570 | ADD CONSTRAINT servicegroups_pkey PRIMARY KEY (servicename, groupname); |
||
571 | |||
572 | |||
573 | --
|
||
574 | -- Name: servicehautniveau_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
575 | --
|
||
576 | |||
577 | ALTER TABLE ONLY servicehautniveau |
||
578 | ADD CONSTRAINT servicehautniveau_pkey PRIMARY KEY (servicename, servicename_dep); |
||
579 | |||
580 | |||
581 | --
|
||
582 | -- Name: servicetopo_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
583 | --
|
||
584 | |||
585 | ALTER TABLE ONLY servicetopo |
||
586 | ADD CONSTRAINT servicetopo_pkey PRIMARY KEY (servicename); |
||
587 | |||
588 | |||
589 | --
|
||
590 | 1ebe6c7c | Thomas ANDREJAK | -- Name: state_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
591 | --
|
||
592 | |||
593 | ALTER TABLE ONLY state |
||
594 | ADD CONSTRAINT state_pkey PRIMARY KEY (idstat); |
||
595 | |||
596 | |||
597 | --
|
||
598 | 2ba99120 | Thomas ANDREJAK | -- Name: tg_group_group_name_key; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
599 | --
|
||
600 | |||
601 | ALTER TABLE ONLY tg_group |
||
602 | ADD CONSTRAINT tg_group_group_name_key UNIQUE (group_name); |
||
603 | |||
604 | |||
605 | --
|
||
606 | -- Name: tg_group_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
607 | --
|
||
608 | |||
609 | ALTER TABLE ONLY tg_group |
||
610 | ADD CONSTRAINT tg_group_pkey PRIMARY KEY (group_id); |
||
611 | |||
612 | |||
613 | --
|
||
614 | -- Name: tg_permission_permission_name_key; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
615 | --
|
||
616 | |||
617 | ALTER TABLE ONLY tg_permission |
||
618 | ADD CONSTRAINT tg_permission_permission_name_key UNIQUE (permission_name); |
||
619 | |||
620 | |||
621 | --
|
||
622 | -- Name: tg_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
623 | --
|
||
624 | |||
625 | ALTER TABLE ONLY tg_permission |
||
626 | ADD CONSTRAINT tg_permission_pkey PRIMARY KEY (permission_id); |
||
627 | |||
628 | |||
629 | --
|
||
630 | -- Name: tg_user_email_address_key; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
631 | --
|
||
632 | |||
633 | ALTER TABLE ONLY tg_user |
||
634 | ADD CONSTRAINT tg_user_email_address_key UNIQUE (email_address); |
||
635 | |||
636 | |||
637 | --
|
||
638 | -- Name: tg_user_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
639 | --
|
||
640 | |||
641 | ALTER TABLE ONLY tg_user |
||
642 | ADD CONSTRAINT tg_user_pkey PRIMARY KEY (user_id); |
||
643 | |||
644 | |||
645 | --
|
||
646 | -- Name: tg_user_user_name_key; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
||
647 | --
|
||
648 | |||
649 | ALTER TABLE ONLY tg_user |
||
650 | ADD CONSTRAINT tg_user_user_name_key UNIQUE (user_name); |
||
651 | |||
652 | |||
653 | --
|
||
654 | 1ebe6c7c | Thomas ANDREJAK | -- Name: version_pkey; Type: CONSTRAINT; Schema: public; Owner: vigiboard; Tablespace:
|
655 | --
|
||
656 | |||
657 | ALTER TABLE ONLY version |
||
658 | ADD CONSTRAINT version_pkey PRIMARY KEY (name); |
||
659 | |||
660 | |||
661 | --
|
||
662 | 2ba99120 | Thomas ANDREJAK | -- Name: ix_event_history_idevent; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
663 | --
|
||
664 | |||
665 | CREATE INDEX ix_event_history_idevent ON event_history USING btree (idevent); |
||
666 | |||
667 | |||
668 | --
|
||
669 | -- Name: ix_events_hostname; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
670 | --
|
||
671 | |||
672 | CREATE INDEX ix_events_hostname ON events USING btree (hostname); |
||
673 | |||
674 | |||
675 | --
|
||
676 | -- Name: ix_events_servicename; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
677 | --
|
||
678 | |||
679 | CREATE INDEX ix_events_servicename ON events USING btree (servicename); |
||
680 | |||
681 | |||
682 | --
|
||
683 | -- Name: ix_groups_parent; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
684 | --
|
||
685 | |||
686 | CREATE INDEX ix_groups_parent ON groups USING btree (parent); |
||
687 | |||
688 | |||
689 | --
|
||
690 | -- Name: ix_host_name; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
691 | --
|
||
692 | |||
693 | CREATE INDEX ix_host_name ON host USING btree (name); |
||
694 | |||
695 | |||
696 | --
|
||
697 | -- Name: ix_hostgroups_groupname; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
698 | --
|
||
699 | |||
700 | CREATE INDEX ix_hostgroups_groupname ON hostgroups USING btree (groupname); |
||
701 | |||
702 | |||
703 | --
|
||
704 | -- Name: ix_perfdatasource_graphname; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
705 | --
|
||
706 | |||
707 | CREATE INDEX ix_perfdatasource_graphname ON perfdatasource USING btree (graphname); |
||
708 | |||
709 | |||
710 | --
|
||
711 | -- Name: ix_perfdatasource_servicename; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
712 | --
|
||
713 | |||
714 | CREATE INDEX ix_perfdatasource_servicename ON perfdatasource USING btree (servicename); |
||
715 | |||
716 | |||
717 | --
|
||
718 | -- Name: ix_service_name; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
719 | --
|
||
720 | |||
721 | CREATE INDEX ix_service_name ON service USING btree (name); |
||
722 | |||
723 | |||
724 | --
|
||
725 | -- Name: ix_servicegroups_groupname; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
726 | --
|
||
727 | |||
728 | CREATE INDEX ix_servicegroups_groupname ON servicegroups USING btree (groupname); |
||
729 | |||
730 | |||
731 | --
|
||
732 | -- Name: ix_servicehautniveau_servicename_dep; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
733 | --
|
||
734 | |||
735 | CREATE INDEX ix_servicehautniveau_servicename_dep ON servicehautniveau USING btree (servicename_dep); |
||
736 | |||
737 | |||
738 | --
|
||
739 | 1ebe6c7c | Thomas ANDREJAK | -- Name: ix_state_hostname; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
740 | --
|
||
741 | |||
742 | CREATE INDEX ix_state_hostname ON state USING btree (hostname); |
||
743 | |||
744 | |||
745 | --
|
||
746 | -- Name: ix_state_servicename; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
747 | --
|
||
748 | |||
749 | CREATE INDEX ix_state_servicename ON state USING btree (servicename); |
||
750 | |||
751 | |||
752 | --
|
||
753 | -- Name: ix_version_name; Type: INDEX; Schema: public; Owner: vigiboard; Tablespace:
|
||
754 | --
|
||
755 | |||
756 | CREATE INDEX ix_version_name ON version USING btree (name); |
||
757 | |||
758 | |||
759 | --
|
||
760 | 2ba99120 | Thomas ANDREJAK | -- Name: event_history_idevent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
761 | --
|
||
762 | |||
763 | ALTER TABLE ONLY event_history |
||
764 | ADD CONSTRAINT event_history_idevent_fkey FOREIGN KEY (idevent) REFERENCES events(idevent); |
||
765 | |||
766 | |||
767 | --
|
||
768 | -- Name: events_hostname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
769 | --
|
||
770 | |||
771 | ALTER TABLE ONLY events |
||
772 | ADD CONSTRAINT events_hostname_fkey FOREIGN KEY (hostname) REFERENCES host(name); |
||
773 | |||
774 | |||
775 | --
|
||
776 | -- Name: events_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
777 | --
|
||
778 | |||
779 | ALTER TABLE ONLY events |
||
780 | ADD CONSTRAINT events_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
781 | |||
782 | |||
783 | --
|
||
784 | -- Name: graphtogroups_graphname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
785 | --
|
||
786 | |||
787 | ALTER TABLE ONLY graphtogroups |
||
788 | ADD CONSTRAINT graphtogroups_graphname_fkey FOREIGN KEY (graphname) REFERENCES graph(name); |
||
789 | |||
790 | |||
791 | --
|
||
792 | -- Name: graphtogroups_groupname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
793 | --
|
||
794 | |||
795 | ALTER TABLE ONLY graphtogroups |
||
796 | ADD CONSTRAINT graphtogroups_groupname_fkey FOREIGN KEY (groupname) REFERENCES graphgroups(name); |
||
797 | |||
798 | |||
799 | --
|
||
800 | -- Name: grouppermissions_groupname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
801 | --
|
||
802 | |||
803 | ALTER TABLE ONLY grouppermissions |
||
804 | ADD CONSTRAINT grouppermissions_groupname_fkey FOREIGN KEY (groupname) REFERENCES groups(name); |
||
805 | |||
806 | |||
807 | --
|
||
808 | -- Name: hostgroups_groupname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
809 | --
|
||
810 | |||
811 | ALTER TABLE ONLY hostgroups |
||
812 | ADD CONSTRAINT hostgroups_groupname_fkey FOREIGN KEY (groupname) REFERENCES groups(name); |
||
813 | |||
814 | |||
815 | --
|
||
816 | -- Name: hostgroups_hostname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
817 | --
|
||
818 | |||
819 | ALTER TABLE ONLY hostgroups |
||
820 | ADD CONSTRAINT hostgroups_hostname_fkey FOREIGN KEY (hostname) REFERENCES host(name); |
||
821 | |||
822 | |||
823 | --
|
||
824 | -- Name: perfdatasource_graphname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
825 | --
|
||
826 | |||
827 | ALTER TABLE ONLY perfdatasource |
||
828 | ADD CONSTRAINT perfdatasource_graphname_fkey FOREIGN KEY (graphname) REFERENCES graph(name); |
||
829 | |||
830 | |||
831 | --
|
||
832 | -- Name: perfdatasource_hostname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
833 | --
|
||
834 | |||
835 | ALTER TABLE ONLY perfdatasource |
||
836 | ADD CONSTRAINT perfdatasource_hostname_fkey FOREIGN KEY (hostname) REFERENCES host(name); |
||
837 | |||
838 | |||
839 | --
|
||
840 | -- Name: perfdatasource_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
841 | --
|
||
842 | |||
843 | ALTER TABLE ONLY perfdatasource |
||
844 | ADD CONSTRAINT perfdatasource_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
845 | |||
846 | |||
847 | --
|
||
848 | -- Name: servicegroups_groupname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
849 | --
|
||
850 | |||
851 | ALTER TABLE ONLY servicegroups |
||
852 | ADD CONSTRAINT servicegroups_groupname_fkey FOREIGN KEY (groupname) REFERENCES groups(name); |
||
853 | |||
854 | |||
855 | --
|
||
856 | -- Name: servicegroups_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
857 | --
|
||
858 | |||
859 | ALTER TABLE ONLY servicegroups |
||
860 | ADD CONSTRAINT servicegroups_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
861 | |||
862 | |||
863 | --
|
||
864 | -- Name: servicehautniveau_servicename_dep_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
865 | --
|
||
866 | |||
867 | ALTER TABLE ONLY servicehautniveau |
||
868 | ADD CONSTRAINT servicehautniveau_servicename_dep_fkey FOREIGN KEY (servicename_dep) REFERENCES service(name); |
||
869 | |||
870 | |||
871 | --
|
||
872 | -- Name: servicehautniveau_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
873 | --
|
||
874 | |||
875 | ALTER TABLE ONLY servicehautniveau |
||
876 | ADD CONSTRAINT servicehautniveau_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
877 | |||
878 | |||
879 | --
|
||
880 | -- Name: servicetopo_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
881 | --
|
||
882 | |||
883 | ALTER TABLE ONLY servicetopo |
||
884 | ADD CONSTRAINT servicetopo_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
885 | |||
886 | |||
887 | --
|
||
888 | 1ebe6c7c | Thomas ANDREJAK | -- Name: state_hostname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
889 | --
|
||
890 | |||
891 | ALTER TABLE ONLY state |
||
892 | ADD CONSTRAINT state_hostname_fkey FOREIGN KEY (hostname) REFERENCES host(name); |
||
893 | |||
894 | |||
895 | --
|
||
896 | -- Name: state_servicename_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
897 | --
|
||
898 | |||
899 | ALTER TABLE ONLY state |
||
900 | ADD CONSTRAINT state_servicename_fkey FOREIGN KEY (servicename) REFERENCES service(name); |
||
901 | |||
902 | |||
903 | --
|
||
904 | 2ba99120 | Thomas ANDREJAK | -- Name: tg_group_permission_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
905 | --
|
||
906 | |||
907 | ALTER TABLE ONLY tg_group_permission |
||
908 | ADD CONSTRAINT tg_group_permission_group_id_fkey FOREIGN KEY (group_id) REFERENCES tg_group(group_id) ON UPDATE CASCADE ON DELETE CASCADE; |
||
909 | |||
910 | |||
911 | --
|
||
912 | -- Name: tg_group_permission_permission_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
913 | --
|
||
914 | |||
915 | ALTER TABLE ONLY tg_group_permission |
||
916 | ADD CONSTRAINT tg_group_permission_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES tg_permission(permission_id) ON UPDATE CASCADE ON DELETE CASCADE; |
||
917 | |||
918 | |||
919 | --
|
||
920 | -- Name: tg_user_group_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
921 | --
|
||
922 | |||
923 | ALTER TABLE ONLY tg_user_group |
||
924 | ADD CONSTRAINT tg_user_group_group_id_fkey FOREIGN KEY (group_id) REFERENCES tg_group(group_id) ON UPDATE CASCADE ON DELETE CASCADE; |
||
925 | |||
926 | |||
927 | --
|
||
928 | -- Name: tg_user_group_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: vigiboard
|
||
929 | --
|
||
930 | |||
931 | ALTER TABLE ONLY tg_user_group |
||
932 | ADD CONSTRAINT tg_user_group_user_id_fkey FOREIGN KEY (user_id) REFERENCES tg_user(user_id) ON UPDATE CASCADE ON DELETE CASCADE; |
||
933 | |||
934 | |||
935 | --
|
||
936 | -- Name: public; Type: ACL; Schema: -; Owner: postgres
|
||
937 | --
|
||
938 | |||
939 | REVOKE ALL ON SCHEMA public FROM PUBLIC; |
||
940 | REVOKE ALL ON SCHEMA public FROM postgres; |
||
941 | GRANT ALL ON SCHEMA public TO postgres; |
||
942 | GRANT ALL ON SCHEMA public TO PUBLIC; |
||
943 | |||
944 | |||
945 | --
|
||
946 | -- PostgreSQL database dump complete
|
||
947 | --
|
||
948 |