source: trunk/LATMOS-Accounts/sqldata/base.sql @ 2318

Last change on this file since 2318 was 2172, checked in by nanardon, 5 years ago

Fix SQL schema version mark

File size: 142.2 KB
Line 
1--- DataBase Schema for LATMOS-Accounts 5.2.34
2--- Schema version 28 build on 2019-01-17T15:11:30
3
4--- To properly deploy as Postgresql Admin run:
5--- CREATE ROLE  laccounts LOGIN PASSWORD 'laccounts' ;
6--- CREATE DATABASE laccounts OWNER laccounts encoding 'UTF-8'
7
8--
9-- PostgreSQL database dump
10--
11
12-- Dumped from database version 9.6.10
13-- Dumped by pg_dump version 9.6.10
14
15SET statement_timeout = 0;
16SET lock_timeout = 0;
17SET idle_in_transaction_session_timeout = 0;
18SET client_encoding = 'UTF8';
19SET standard_conforming_strings = on;
20SELECT pg_catalog.set_config('search_path', '', false);
21SET check_function_bodies = false;
22SET client_min_messages = warning;
23SET row_security = off;
24
25--
26-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
27--
28
29CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
30
31
32--
33-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
34--
35
36COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
37
38
39--
40-- Name: accreq_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
41--
42
43CREATE FUNCTION public.accreq_attr_update_ref() RETURNS trigger
44    LANGUAGE plpgsql
45    AS $$begin
46
47IF (TG_OP != 'INSERT') then
48update "accreq" set date = now() where "accreq".ikey = old.okey;
49end if;
50IF (TG_OP != 'DELETE') then
51update "accreq"  set date = now() where "accreq".ikey = new.okey;
52end if;
53
54IF (TG_OP = 'DELETE') then
55  return old;
56ELSE
57  return new;
58END IF;
59
60END;$$;
61
62
63--
64-- Name: address_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
65--
66
67CREATE FUNCTION public.address_attr_update_ref() RETURNS trigger
68    LANGUAGE plpgsql
69    AS $$begin
70
71IF (TG_OP != 'INSERT') then
72update "address" set date = now() where "address".ikey = old.okey;
73end if;
74IF (TG_OP != 'DELETE') then
75update "address"  set date = now() where "address".ikey = new.okey;
76end if;
77
78IF (TG_OP = 'DELETE') then
79  return old;
80ELSE
81  return new;
82END IF;
83
84END;$$;
85
86
87--
88-- Name: address_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
89--
90
91CREATE FUNCTION public.address_sort_fields() RETURNS trigger
92    LANGUAGE plpgsql
93    AS $$BEGIN
94
95IF (TG_OP='INSERT') then
96IF (new.attr='site') THEN
97insert into address_attributes_site VALUES (new.*);
98RETURN NULL;
99END IF;
100
101IF (new.attr = 'isMainAddress') then
102-- remove isMainAddress from other address
103-- for of the user
104delete from address_attributes_base where
105attr = 'isMainAddress' and
106okey in (
107select addr.ikey from address as addr join
108  address on addr.user = address.user
109  where 
110  address.ikey = new.okey and addr.ikey != new.okey
111);
112END IF;
113end if;
114
115if (TG_OP='DELETE') THEN
116RETURN old;
117else
118RETURN new;
119end if;
120END;$$;
121
122
123--
124-- Name: address_update_user_rev(); Type: FUNCTION; Schema: public; Owner: -
125--
126
127CREATE FUNCTION public.address_update_user_rev() RETURNS trigger
128    LANGUAGE plpgsql
129    AS $$begin
130
131IF (TG_OP = 'DELETE') THEN
132update "user" set "date" = now() where "name" = old."user";
133return old;
134ELSE
135update "user" set "date" = now() where "name" = new."user";
136return new;
137end if;
138
139end;$$;
140
141
142--
143-- Name: aliases_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
144--
145
146CREATE FUNCTION public.aliases_attr_update_ref() RETURNS trigger
147    LANGUAGE plpgsql
148    AS $$begin
149
150            IF (TG_OP != 'INSERT') then
151            update "aliases" set date = now() where "aliases".ikey = old.okey;
152            end if;
153            IF (TG_OP != 'DELETE') then
154            update "aliases"  set date = now() where "aliases".ikey = new.okey;
155            end if;
156
157            IF (TG_OP = 'DELETE') then
158            return old;
159            ELSE
160            return new;
161            END IF;
162
163            END;$$;
164
165
166--
167-- Name: aliases_nickname(); Type: FUNCTION; Schema: public; Owner: -
168--
169
170CREATE FUNCTION public.aliases_nickname() RETURNS trigger
171    LANGUAGE plpgsql
172    AS $$begin
173
174IF TG_OP='DELETE' THEN
175delete from user_attributes where attr='nickname' and value=old.name;
176RETURN old;
177END IF;
178
179IF TG_OP='UPDATE' THEN
180IF new.forward <> old.forward THEN
181delete from user_attributes where attr='nickname' and value=old.name;
182RETURN new;
183END IF;
184END IF;
185
186IF TG_OP='DELETE' then
187return old;
188ELSE
189return new;
190END IF;
191END;$$;
192
193
194--
195-- Name: department_group_upd_f(); Type: FUNCTION; Schema: public; Owner: -
196--
197
198CREATE FUNCTION public.department_group_upd_f() RETURNS trigger
199    LANGUAGE plpgsql
200    AS $$BEGIN
201
202IF (new.attr = 'department') then
203  BEGIN
204  insert into group_attributes (okey, attr, value)
205  select "group"."ikey", 'memberUID', "user"."name"
206  from "user", "group"
207  where "group"."name" = new."value" and "user".ikey = new.okey;
208  EXCEPTION WHEN unique_violation THEN
209  END;
210END IF;
211
212RETURN new;
213END;$$;
214
215
216--
217-- Name: employment_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
218--
219
220CREATE FUNCTION public.employment_attr_update_ref() RETURNS trigger
221    LANGUAGE plpgsql
222    AS $$begin
223
224            IF (TG_OP != 'INSERT') then
225            update "employment" set date = now() where "employment".ikey = old.okey;
226            end if;
227            IF (TG_OP != 'DELETE') then
228            update "employment"  set date = now() where "employment".ikey = new.okey;
229            end if;
230
231            IF (TG_OP = 'DELETE') then
232            return old;
233            ELSE
234            return new;
235            END IF;
236
237            END;$$;
238
239
240--
241-- Name: fmt_macaddr(); Type: FUNCTION; Schema: public; Owner: -
242--
243
244CREATE FUNCTION public.fmt_macaddr() RETURNS trigger
245    LANGUAGE plpgsql
246    AS $$begin
247
248new.value := new.value::macaddr::text;
249
250return new;
251end;$$;
252
253
254--
255-- Name: group_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
256--
257
258CREATE FUNCTION public.group_attr_update_ref() RETURNS trigger
259    LANGUAGE plpgsql
260    AS $$begin
261
262IF (TG_OP != 'INSERT') then
263update "group"  set date = now() where "group"."ikey" = old.okey;
264end if;
265IF (TG_OP != 'DELETE') then
266update "group"  set date = now() where "group"."ikey" = new.okey;
267end if;
268
269IF (TG_OP = 'DELETE') then
270  return old;
271ELSE
272  return new;
273END IF;
274
275END;$$;
276
277
278--
279-- Name: group_attr_user_update_user_ref(); Type: FUNCTION; Schema: public; Owner: -
280--
281
282CREATE FUNCTION public.group_attr_user_update_user_ref() RETURNS trigger
283    LANGUAGE plpgsql
284    AS $$begin
285
286IF (TG_OP != 'INSERT') then
287update "user"  set date = now() where "user"."name" = old.value;
288end if;
289IF (TG_OP != 'DELETE') then
290update "user"  set date = now() where "user"."name" = new.value;
291end if;
292
293IF (TG_OP = 'DELETE') then
294  return old;
295ELSE
296  return new;
297END IF;
298
299END;$$;
300
301
302--
303-- Name: group_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
304--
305
306CREATE FUNCTION public.group_sort_fields() RETURNS trigger
307    LANGUAGE plpgsql
308    AS $$BEGIN
309
310              IF (TG_OP='INSERT') then
311              IF (new.attr='managedBy'
312                  OR  new.attr='managedAlsoBy'
313                  OR  new.attr='member'
314                  OR  new.attr='memberUID') THEN
315              insert into group_attributes_users VALUES (new.*);
316              RETURN NULL;
317              END IF;
318
319              IF (new.attr='sutype') THEN
320              insert into group_attributes_sutypes VALUES (new.*);
321              RETURN NULL;
322              END IF;
323              end if;
324
325
326              IF (TG_OP = 'UPDATE') THEN
327              IF (new.attr='gidNumber') then
328              update "group" set gidnumber = new.value::integer where
329              "group".ikey = new.okey;
330              RETURN NULL;
331              END IF;
332              END IF;
333
334              IF (TG_OP = 'DELETE') THEN
335              IF (old.attr='exported') then
336              update "group" set exported = false where "group".ikey = old.okey;
337              return null;
338              end if;
339              else
340              IF (new.attr='exported') then
341              update "group" set exported = true where "group".ikey = new.okey;
342              RETURN NULL;
343              end if;
344              END IF;
345
346              if (TG_OP='DELETE') THEN
347              RETURN old;
348              else
349              RETURN new;
350              end if;
351              END;$$;
352
353
354--
355-- Name: nethost_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
356--
357
358CREATE FUNCTION public.nethost_attr_update_ref() RETURNS trigger
359    LANGUAGE plpgsql
360    AS $$begin
361
362IF (TG_OP != 'INSERT') then
363update "nethost" set date = now() where "nethost".ikey = old.okey;
364end if;
365IF (TG_OP != 'DELETE') then
366update "nethost"  set date = now() where "nethost".ikey = new.okey;
367end if;
368
369IF (TG_OP = 'DELETE') then
370  return old;
371ELSE
372  return new;
373END IF;
374
375END;$$;
376
377
378--
379-- Name: nethost_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
380--
381
382CREATE FUNCTION public.nethost_sort_fields() RETURNS trigger
383    LANGUAGE plpgsql
384    AS $$BEGIN
385
386              IF (TG_OP='INSERT') then
387              IF (new.attr='ip') THEN
388              insert into nethost_attributes_ips VALUES (new.*);
389              RETURN NULL;
390              END IF;
391
392              IF (new.attr='macaddr') THEN
393              insert into nethost_attributes_macs VALUES (new.*);
394              RETURN NULL;
395              END IF;
396
397              IF (new.attr='owner') THEN
398              insert into nethost_attributes_users VALUES (new.*);
399              RETURN NULL;
400              END IF;
401
402              IF (new.attr='user') THEN
403              insert into nethost_attributes_users VALUES (new.*);
404              RETURN NULL;
405              END IF;
406
407              IF (new.attr='related') THEN
408              insert into nethost_attributes_nethosts VALUES (new.*);
409              RETURN NULL;
410              END IF;
411              end if;
412
413              if (TG_OP='DELETE') THEN
414              RETURN old;
415              else
416              RETURN new;
417              end if;
418              END;$$;
419
420
421--
422-- Name: nethost_upd_zone(); Type: FUNCTION; Schema: public; Owner: -
423--
424
425CREATE FUNCTION public.nethost_upd_zone() RETURNS trigger
426    LANGUAGE plpgsql
427    AS $$begin
428
429  IF (TG_OP = 'DELETE') THEN
430    update netzone set date=now() where ikey in
431    (
432    select okey from netzone_attributes where attr='allow_dyn'
433    union
434    select netzone_attributes.okey from netzone_attributes join
435    nethost_attributes_ips on netzone_attributes.attr='net' and 
436    nethost_attributes_ips.value::inet <<= netzone_attributes.value::inet
437    where nethost_attributes_ips.okey = old.ikey
438    );
439  END IF;
440  IF (TG_OP = 'INSERT' or TG_OP = 'UPDATE') THEN
441    update netzone set date=now() where ikey in
442    (
443    select okey from netzone_attributes where attr='allow_dyn'
444    union
445    select netzone_attributes.okey from netzone_attributes join
446    nethost_attributes_ips on netzone_attributes.attr='net' and 
447    nethost_attributes_ips.value::inet <<= netzone_attributes.value::inet
448    where nethost_attributes_ips.okey = new.ikey
449    );
450  END IF;
451
452 IF (TG_OP = 'DELETE') THEN
453   return old;
454 ELSE
455   return new;
456 END IF;
457
458END;$$;
459
460
461--
462-- Name: nethostipdel_upd_zone(); Type: FUNCTION; Schema: public; Owner: -
463--
464
465CREATE FUNCTION public.nethostipdel_upd_zone() RETURNS trigger
466    LANGUAGE plpgsql
467    AS $$begin
468
469
470    update netzone set date=now() where ikey in
471    (
472    select okey from netzone_attributes where attr='allow_dyn'
473    union
474    select okey from netzone_attributes where attr='net' and
475    old.value::inet <<= netzone_attributes.value::inet
476    );
477
478   return old;
479 
480END;$$;
481
482
483--
484-- Name: netzone_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
485--
486
487CREATE FUNCTION public.netzone_attr_update_ref() RETURNS trigger
488    LANGUAGE plpgsql
489    AS $$begin
490
491IF (TG_OP != 'INSERT') then
492update "netzone" set date = now() where "netzone".ikey = old.okey;
493end if;
494IF (TG_OP != 'DELETE') then
495update "netzone"  set date = now() where "netzone".ikey = new.okey;
496end if;
497
498IF (TG_OP = 'DELETE') then
499  return old;
500ELSE
501  return new;
502END IF;
503
504END;$$;
505
506
507--
508-- Name: netzone_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
509--
510
511CREATE FUNCTION public.netzone_sort_fields() RETURNS trigger
512    LANGUAGE plpgsql
513    AS $$BEGIN
514
515IF (TG_OP='INSERT') then
516IF (new.attr='site') THEN
517insert into netzone_attributes_site VALUES (new.*);
518RETURN NULL;
519END IF;
520
521IF (new.attr='dynFrom') THEN
522insert into netzone_attributes_netzone VALUES (new.*);
523RETURN NULL;
524END IF;
525
526end if;
527
528if (TG_OP='DELETE') THEN
529RETURN old;
530else
531RETURN new;
532end if;
533END;$$;
534
535
536--
537-- Name: person_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
538--
539
540CREATE FUNCTION public.person_attr_update_ref() RETURNS trigger
541    LANGUAGE plpgsql
542    AS $$begin
543
544IF (TG_OP != 'INSERT') then
545update "user" set date = now() where "user".ikey = old.okey;
546update "group" set date = now() where "group".name = old.value;
547end if;
548IF (TG_OP != 'DELETE') then
549update "user"  set date = now() where "user".ikey = new.okey;
550update "group" set date = now() where "group".name = new.value;
551end if;
552
553IF (TG_OP = 'DELETE') then
554  return old;
555ELSE
556  return new;
557END IF;
558
559END;$$;
560
561
562--
563-- Name: rev_tg_aliases_f(); Type: FUNCTION; Schema: public; Owner: -
564--
565
566CREATE FUNCTION public.rev_tg_aliases_f() RETURNS trigger
567    LANGUAGE plpgsql
568    AS $$begin
569
570            IF (TG_OP = 'DELETE') THEN
571            update "user" set rev = nextval('revisions_rev_seq'::regclass), "date" = now() where "name" = ANY (old.forward);
572            return old;
573            ELSE
574                IF (TG_OP = 'UPDATE') THEN
575                update "user" set rev = nextval('revisions_rev_seq'::regclass), "date" = now() where "name" = ANY (old.forward);
576                END IF;
577            update "user" set rev = nextval('revisions_rev_seq'::regclass), "date" = now() where "name" = ANY (new.forward);
578            return new;
579            END IF;
580
581            end;$$;
582
583
584--
585-- Name: rev_tg_f(); Type: FUNCTION; Schema: public; Owner: -
586--
587
588CREATE FUNCTION public.rev_tg_f() RETURNS trigger
589    LANGUAGE plpgsql
590    AS $$begin
591
592IF (TG_OP = 'DELETE') THEN
593  update settings set val = old.ikey where varname = 'last-delete';
594  IF NOT FOUND THEN
595    insert into settings (varname, val) values ('last-delete', old.ikey);
596  END IF;
597  return old;
598else
599  IF (TG_OP = 'INSERT') THEN
600  new.rev := nextval('public.revisions_rev_seq'::regclass);
601  new.date := now();
602  ELSIF (old.rev = new.rev) THEN
603  new.rev := nextval('public.revisions_rev_seq'::regclass);
604  new.date := now();
605  END IF; 
606  return new;
607END IF;
608
609end;$$;
610
611
612--
613-- Name: service_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
614--
615
616CREATE FUNCTION public.service_attr_update_ref() RETURNS trigger
617    LANGUAGE plpgsql
618    AS $$begin
619
620            IF (TG_OP != 'INSERT') then
621            update "service" set date = now() where "service".ikey = old.okey;
622            end if;
623            IF (TG_OP != 'DELETE') then
624            update "service"  set date = now() where "service".ikey = new.okey;
625            end if;
626
627            IF (TG_OP = 'DELETE') then
628            return old;
629            ELSE
630            return new;
631            END IF;
632
633            END;$$;
634
635
636--
637-- Name: service_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
638--
639
640CREATE FUNCTION public.service_sort_fields() RETURNS trigger
641    LANGUAGE plpgsql
642    AS $$BEGIN
643
644              if (TG_OP='INSERT' or TG_OP='UPDATE') THEN
645              IF (new.attr='manager') THEN
646              insert into service_attributes_users VALUES (new.*);
647              RETURN NULL;
648              END IF;
649              END IF;
650
651              if (TG_OP='DELETE') THEN
652              RETURN old;
653              else
654              RETURN new;
655              end if;
656              END;$$;
657
658
659--
660-- Name: site_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
661--
662
663CREATE FUNCTION public.site_attr_update_ref() RETURNS trigger
664    LANGUAGE plpgsql
665    AS $$begin
666
667IF (TG_OP != 'INSERT') then
668update "site" set date = now() where "site".ikey = old.okey;
669end if;
670IF (TG_OP != 'DELETE') then
671update "site"  set date = now() where "site".ikey = new.okey;
672end if;
673
674IF (TG_OP = 'DELETE') then
675  return old;
676ELSE
677  return new;
678END IF;
679
680END;$$;
681
682
683--
684-- Name: stat_attr_update_ref(); Type: FUNCTION; Schema: public; Owner: -
685--
686
687CREATE FUNCTION public.stat_attr_update_ref() RETURNS trigger
688    LANGUAGE plpgsql
689    AS $$begin
690
691            IF (TG_OP != 'INSERT') then
692            update "stat" set date = now() where "stat".ikey = old.okey;
693            end if;
694            IF (TG_OP != 'DELETE') then
695            update "stat"  set date = now() where "stat".ikey = new.okey;
696            end if;
697
698            IF (TG_OP = 'DELETE') then
699            return old;
700            ELSE
701            return new;
702            END IF;
703
704            END;$$;
705
706
707--
708-- Name: update_address_site(); Type: FUNCTION; Schema: public; Owner: -
709--
710
711CREATE FUNCTION public.update_address_site() RETURNS trigger
712    LANGUAGE plpgsql
713    AS $$begin
714
715IF (TG_OP='DELETE') then
716update address set date = now() where ikey in
717(select okey from address_attributes where attr = 'site' and
718value = old.name);
719return old;
720ELSE
721update address set date = now() where ikey in
722(select okey from address_attributes where attr = 'site' and
723value = new.name);
724return new;
725end if;
726
727end;$$;
728
729
730--
731-- Name: user_sort_fields(); Type: FUNCTION; Schema: public; Owner: -
732--
733
734CREATE FUNCTION public.user_sort_fields() RETURNS trigger
735    LANGUAGE plpgsql
736    AS $$DECLARE
737            rec RECORD;
738            BEGIN
739
740            IF (TG_OP='UPDATE' or TG_OP='INSERT') THEN
741
742            IF (new.attr='locked') THEN
743            IF (TG_OP = 'INSERT') THEN
744            new.value = now()::text;
745            ELSIF (TG_OP='UPDATE') THEN
746            new.value = old.value;
747            END IF;
748            END IF;
749
750            IF (new.attr='nickname') THEN
751            PERFORM 1 from "user" where "user".ikey = new.okey
752                and new.value = "user".name;
753            IF NOT FOUND THEN
754            select aliases.name into rec from aliases join "user"
755            on array["user".name] = aliases.forward
756            where "user".ikey = new.okey and aliases.name = new.value;
757            IF NOT FOUND THEN
758            insert into aliases ("name", "forward", "description", exported)
759            select new.value, array["user".name], 'Forward for ' || "user".name || ' nickname', "user".exported from "user" where "user".ikey = new.okey;
760            END IF;
761            END IF;
762            END IF;
763
764            IF (new.attr='uidNumber') THEN
765            update "user" set uidnumber = new.value::integer where ikey = new.okey;
766            RETURN NULL;
767            END IF;
768
769            IF (new.attr='gidNumber') THEN
770            update "user" set gidnumber = new.value::integer where ikey = new.okey;
771            RETURN null;
772            END IF;
773
774            IF (new.attr='expire') THEN
775            update "user" set expire = new.value::timestamp where ikey = new.okey;
776            RETURN NULL;
777            END IF;
778
779            IF (new.attr='exported') THEN
780            update "user" set exported = true where ikey = new.okey;
781            RETURN NULL;
782            END IF;
783
784            END IF;
785
786            IF (TG_OP = 'DELETE') THEN
787
788            IF (old.attr='expire') THEN
789            update "user" set expire = NULL where ikey = old.okey;
790            RETURN NULL;
791            END IF;
792
793            IF (old.attr='exported') THEN
794            update "user" set exported = false where ikey = old.okey;
795            RETURN NULL;
796            END IF;
797
798            END IF;
799
800
801            IF (TG_OP='INSERT') THEN
802            IF (new.attr='manager') THEN
803            insert into user_attributes_users VALUES (new.*);
804            RETURN NULL;
805            END IF;
806
807            IF (new.attr='site') THEN
808            insert into user_attributes_site VALUES (new.*);
809            RETURN NULL;
810            END IF;
811
812            IF (new.attr='department') THEN
813            insert into user_attributes_groups VALUES (new.*);
814            RETURN NULL;
815            END IF;
816
817            IF (new.attr='contratType') THEN
818            insert into user_attributes_groups VALUES (new.*);
819            RETURN NULL;
820            END IF;
821
822            IF (new.attr='jobType') THEN
823            insert into user_attributes_groups VALUES (new.*);
824            RETURN NULL;
825            END IF;
826
827            END IF;
828
829            IF (TG_OP='DELETE') then
830            RETURN old;
831            ELSE
832            RETURN new;
833            end if;
834            END;$$;
835
836
837--
838-- Name: ikey_seq; Type: SEQUENCE; Schema: public; Owner: -
839--
840
841CREATE SEQUENCE public.ikey_seq
842    START WITH 1
843    INCREMENT BY 1
844    NO MINVALUE
845    NO MAXVALUE
846    CACHE 1;
847
848
849SET default_tablespace = '';
850
851SET default_with_oids = false;
852
853--
854-- Name: revisions; Type: TABLE; Schema: public; Owner: -
855--
856
857CREATE TABLE public.revisions (
858    rev integer NOT NULL,
859    date timestamp with time zone DEFAULT now() NOT NULL,
860    "create" timestamp with time zone DEFAULT now() NOT NULL,
861    ikey integer DEFAULT nextval('public.ikey_seq'::regclass) NOT NULL
862);
863
864
865--
866-- Name: objects; Type: TABLE; Schema: public; Owner: -
867--
868
869CREATE TABLE public.objects (
870    exported boolean DEFAULT true NOT NULL,
871    name text NOT NULL,
872    createdby text,
873    modifiedby text,
874    oalias text,
875    internobject boolean DEFAULT false NOT NULL,
876    nodelete boolean DEFAULT false NOT NULL,
877    oaliascache text
878)
879INHERITS (public.revisions);
880
881
882--
883-- Name: accreq; Type: TABLE; Schema: public; Owner: -
884--
885
886CREATE TABLE public.accreq (
887)
888INHERITS (public.objects);
889
890
891--
892-- Name: attributes; Type: TABLE; Schema: public; Owner: -
893--
894
895CREATE TABLE public.attributes (
896    value text NOT NULL,
897    attr_key integer NOT NULL,
898    okey integer NOT NULL,
899    attr text NOT NULL
900);
901
902
903--
904-- Name: accreq_attributes; Type: TABLE; Schema: public; Owner: -
905--
906
907CREATE TABLE public.accreq_attributes (
908)
909INHERITS (public.attributes);
910
911
912--
913-- Name: attributes_list; Type: TABLE; Schema: public; Owner: -
914--
915
916CREATE TABLE public.attributes_list (
917    canonical text NOT NULL,
918    ikey integer DEFAULT nextval('public.ikey_seq'::regclass) NOT NULL,
919    description text
920);
921
922
923--
924-- Name: COLUMN attributes_list.canonical; Type: COMMENT; Schema: public; Owner: -
925--
926
927COMMENT ON COLUMN public.attributes_list.canonical IS 'Nom de l''attribut';
928
929
930--
931-- Name: COLUMN attributes_list.ikey; Type: COMMENT; Schema: public; Owner: -
932--
933
934COMMENT ON COLUMN public.attributes_list.ikey IS 'Clef interne à la base';
935
936
937--
938-- Name: revisions_rev_seq; Type: SEQUENCE; Schema: public; Owner: -
939--
940
941CREATE SEQUENCE public.revisions_rev_seq
942    START WITH 1
943    INCREMENT BY 1
944    NO MINVALUE
945    NO MAXVALUE
946    CACHE 1;
947
948
949--
950-- Name: revisions_rev_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
951--
952
953ALTER SEQUENCE public.revisions_rev_seq OWNED BY public.revisions.rev;
954
955
956--
957-- Name: accreq_attributes_list; Type: TABLE; Schema: public; Owner: -
958--
959
960CREATE TABLE public.accreq_attributes_list (
961    ikey integer DEFAULT nextval('public.ikey_seq'::regclass),
962    rev integer DEFAULT nextval('public.revisions_rev_seq'::regclass) NOT NULL,
963    date timestamp with time zone DEFAULT now() NOT NULL,
964    "create" timestamp with time zone DEFAULT now() NOT NULL
965)
966INHERITS (public.attributes_list);
967
968
969--
970-- Name: address_seq; Type: SEQUENCE; Schema: public; Owner: -
971--
972
973CREATE SEQUENCE public.address_seq
974    START WITH 1
975    INCREMENT BY 1
976    NO MINVALUE
977    NO MAXVALUE
978    CACHE 1;
979
980
981--
982-- Name: address; Type: TABLE; Schema: public; Owner: -
983--
984
985CREATE TABLE public.address (
986    name text DEFAULT ('address'::text || (nextval('public.address_seq'::regclass))::text),
987    "user" text NOT NULL,
988    expire timestamp with time zone
989)
990INHERITS (public.objects);
991
992
993--
994-- Name: address_attributes_base; Type: TABLE; Schema: public; Owner: -
995--
996
997CREATE TABLE public.address_attributes_base (
998)
999INHERITS (public.attributes);
1000
1001
1002--
1003-- Name: user; Type: TABLE; Schema: public; Owner: -
1004--
1005
1006CREATE TABLE public."user" (
1007    name text,
1008    uidnumber integer NOT NULL,
1009    gidnumber integer NOT NULL,
1010    expire timestamp with time zone,
1011    endcircuit timestamp with time zone,
1012    CONSTRAINT uid_not_empty CHECK ((name <> ''::text))
1013)
1014INHERITS (public.objects);
1015
1016
1017--
1018-- Name: address_attributes; Type: VIEW; Schema: public; Owner: -
1019--
1020
1021CREATE VIEW public.address_attributes AS
1022 SELECT address."user" AS value,
1023    'user'::text AS attr,
1024    address.rev AS attr_key,
1025    address.ikey AS okey
1026   FROM public.address
1027UNION ALL
1028 SELECT address.name AS value,
1029    'name'::text AS attr,
1030    address.rev AS attr_key,
1031    address.ikey AS okey
1032   FROM public.address
1033UNION ALL
1034 SELECT address_attributes.value,
1035    address_attributes.attr,
1036    address_attributes.attr_key,
1037    address_attributes.okey
1038   FROM public.address_attributes_base address_attributes
1039UNION ALL
1040 SELECT '1'::text AS value,
1041    'active'::text AS attr,
1042    address.rev AS attr_key,
1043    address.ikey AS okey
1044   FROM (public."user"
1045     JOIN public.address ON (("user".name = address."user")))
1046  WHERE ("user".exported AND address.exported AND (("user".expire IS NULL) OR ("user".expire > now())));
1047
1048
1049--
1050-- Name: address_attributes_list; Type: TABLE; Schema: public; Owner: -
1051--
1052
1053CREATE TABLE public.address_attributes_list (
1054    rev integer DEFAULT nextval('public.revisions_rev_seq'::regclass),
1055    date timestamp with time zone DEFAULT now(),
1056    "create" timestamp with time zone DEFAULT now()
1057)
1058INHERITS (public.attributes_list, public.revisions);
1059
1060
1061--
1062-- Name: address_attributes_list_site; Type: TABLE; Schema: public; Owner: -
1063--
1064
1065CREATE TABLE public.address_attributes_list_site (
1066)
1067INHERITS (public.address_attributes_list);
1068
1069
1070--
1071-- Name: address_attributes_site; Type: TABLE; Schema: public; Owner: -
1072--
1073
1074CREATE TABLE public.address_attributes_site (
1075)
1076INHERITS (public.address_attributes_base);
1077
1078
1079--
1080-- Name: aliases; Type: TABLE; Schema: public; Owner: -
1081--
1082
1083CREATE TABLE public.aliases (
1084    forward text[],
1085    expire timestamp with time zone,
1086    description text
1087)
1088INHERITS (public.objects);
1089
1090
1091--
1092-- Name: TABLE aliases; Type: COMMENT; Schema: public; Owner: -
1093--
1094
1095COMMENT ON TABLE public.aliases IS 'Mail aliases';
1096
1097
1098--
1099-- Name: aliases_attributes_base; Type: TABLE; Schema: public; Owner: -
1100--
1101
1102CREATE TABLE public.aliases_attributes_base (
1103)
1104INHERITS (public.attributes);
1105
1106
1107--
1108-- Name: aliases_attributes; Type: VIEW; Schema: public; Owner: -
1109--
1110
1111CREATE VIEW public.aliases_attributes AS
1112 SELECT "user".name AS value,
1113    'user'::text AS attr,
1114    aliases.rev AS attr_key,
1115    aliases.ikey AS okey
1116   FROM (public.aliases
1117     JOIN public."user" ON (((aliases.name = "user".name) OR (aliases.forward = ARRAY["user".name]))))
1118UNION ALL
1119 SELECT aliases_attributes_base.value,
1120    aliases_attributes_base.attr,
1121    aliases_attributes_base.attr_key,
1122    aliases_attributes_base.okey
1123   FROM public.aliases_attributes_base
1124UNION ALL
1125 SELECT aliases.name AS value,
1126    'name'::text AS attr,
1127    aliases.rev AS attr_key,
1128    aliases.ikey AS okey
1129   FROM public.aliases;
1130
1131
1132--
1133-- Name: aliases_attributes_list; Type: TABLE; Schema: public; Owner: -
1134--
1135
1136CREATE TABLE public.aliases_attributes_list (
1137    ikey integer DEFAULT nextval('public.ikey_seq'::regclass),
1138    canonical text,
1139    description text
1140)
1141INHERITS (public.revisions, public.attributes_list);
1142
1143
1144--
1145-- Name: all_obj_attributes; Type: VIEW; Schema: public; Owner: -
1146--
1147
1148CREATE VIEW public.all_obj_attributes AS
1149 SELECT pg_class.relname,
1150    objects.name,
1151    attributes_list.description,
1152    attributes.attr_key,
1153    attributes.attr,
1154    attributes.value
1155   FROM (((public.attributes_list
1156     JOIN public.attributes ON ((attributes.attr = attributes_list.canonical)))
1157     JOIN pg_class ON ((attributes.tableoid = pg_class.oid)))
1158     JOIN public.objects ON ((objects.ikey = attributes.okey)));
1159
1160
1161--
1162-- Name: attributes_attr_key_seq; Type: SEQUENCE; Schema: public; Owner: -
1163--
1164
1165CREATE SEQUENCE public.attributes_attr_key_seq
1166    START WITH 1
1167    INCREMENT BY 1
1168    NO MINVALUE
1169    NO MAXVALUE
1170    CACHE 1;
1171
1172
1173--
1174-- Name: attributes_attr_key_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1175--
1176
1177ALTER SEQUENCE public.attributes_attr_key_seq OWNED BY public.attributes.attr_key;
1178
1179
1180--
1181-- Name: attributes_values; Type: TABLE; Schema: public; Owner: -
1182--
1183
1184CREATE TABLE public.attributes_values (
1185    otype text NOT NULL,
1186    attributes text NOT NULL,
1187    value text NOT NULL
1188)
1189INHERITS (public.revisions);
1190
1191
1192--
1193-- Name: employment; Type: TABLE; Schema: public; Owner: -
1194--
1195
1196CREATE TABLE public.employment (
1197    name text,
1198    "user" text NOT NULL,
1199    firstday date DEFAULT now() NOT NULL,
1200    lastday date,
1201    CONSTRAINT employment_check CHECK (((lastday IS NULL) OR (firstday <= lastday)))
1202)
1203INHERITS (public.objects);
1204
1205
1206--
1207-- Name: employment_attributes; Type: TABLE; Schema: public; Owner: -
1208--
1209
1210CREATE TABLE public.employment_attributes (
1211)
1212INHERITS (public.attributes);
1213
1214
1215--
1216-- Name: employment_attributes_list; Type: TABLE; Schema: public; Owner: -
1217--
1218
1219CREATE TABLE public.employment_attributes_list (
1220)
1221INHERITS (public.revisions, public.attributes_list);
1222
1223
1224--
1225-- Name: group; Type: TABLE; Schema: public; Owner: -
1226--
1227
1228CREATE TABLE public."group" (
1229    name text,
1230    gidnumber integer NOT NULL,
1231    CONSTRAINT group_name_not_empty CHECK ((name <> ''::text))
1232)
1233INHERITS (public.objects);
1234
1235
1236--
1237-- Name: group_attributes_base; Type: TABLE; Schema: public; Owner: -
1238--
1239
1240CREATE TABLE public.group_attributes_base (
1241)
1242INHERITS (public.attributes);
1243
1244
1245--
1246-- Name: user_attributes_base; Type: TABLE; Schema: public; Owner: -
1247--
1248
1249CREATE TABLE public.user_attributes_base (
1250)
1251INHERITS (public.attributes);
1252
1253
1254--
1255-- Name: group_attributes; Type: VIEW; Schema: public; Owner: -
1256--
1257
1258CREATE VIEW public.group_attributes AS
1259 SELECT ("group".gidnumber)::text AS value,
1260    'gidnumber'::text AS attr,
1261    "group".rev AS attr_key,
1262    "group".ikey AS okey
1263   FROM public."group"
1264UNION ALL
1265 SELECT "group".name AS value,
1266    'name'::text AS attr,
1267    "group".rev AS attr_key,
1268    "group".ikey AS okey
1269   FROM public."group"
1270UNION ALL
1271 SELECT '1'::text AS value,
1272    'exported'::text AS attr,
1273    "group".rev AS attr_key,
1274    "group".ikey AS okey
1275   FROM public."group"
1276  WHERE ("group".exported = true)
1277UNION ALL
1278 SELECT group_attributes.value,
1279    group_attributes.attr,
1280    group_attributes.attr_key,
1281    group_attributes.okey
1282   FROM public.group_attributes_base group_attributes
1283UNION ALL
1284 SELECT "user".name AS value,
1285    'memberUID'::text AS attr,
1286    user_attributes_base.attr_key,
1287    "group".ikey AS okey
1288   FROM ((public.user_attributes_base
1289     JOIN public."user" ON (("user".ikey = user_attributes_base.okey)))
1290     JOIN public."group" ON (("group".name = user_attributes_base.value)))
1291  WHERE (user_attributes_base.attr = 'contratType'::text);
1292
1293
1294--
1295-- Name: group_attributes_list; Type: TABLE; Schema: public; Owner: -
1296--
1297
1298CREATE TABLE public.group_attributes_list (
1299)
1300INHERITS (public.revisions, public.attributes_list);
1301
1302
1303--
1304-- Name: group_attributes_sutypes; Type: TABLE; Schema: public; Owner: -
1305--
1306
1307CREATE TABLE public.group_attributes_sutypes (
1308)
1309INHERITS (public.group_attributes_base);
1310
1311
1312--
1313-- Name: group_attributes_users; Type: TABLE; Schema: public; Owner: -
1314--
1315
1316CREATE TABLE public.group_attributes_users (
1317)
1318INHERITS (public.group_attributes_base);
1319
1320
1321--
1322-- Name: nethost; Type: TABLE; Schema: public; Owner: -
1323--
1324
1325CREATE TABLE public.nethost (
1326    expire timestamp with time zone
1327)
1328INHERITS (public.objects);
1329
1330
1331--
1332-- Name: nethost_attributes; Type: TABLE; Schema: public; Owner: -
1333--
1334
1335CREATE TABLE public.nethost_attributes (
1336)
1337INHERITS (public.attributes);
1338
1339
1340--
1341-- Name: nethost_attributes_macs; Type: TABLE; Schema: public; Owner: -
1342--
1343
1344CREATE TABLE public.nethost_attributes_macs (
1345    CONSTRAINT nethost_valid_mac_address CHECK (((value)::macaddr <> '00:00:00:00:00:00'::macaddr))
1346)
1347INHERITS (public.nethost_attributes);
1348
1349
1350--
1351-- Name: macentry; Type: VIEW; Schema: public; Owner: -
1352--
1353
1354CREATE VIEW public.macentry AS
1355 SELECT nethost.rev,
1356    nethost.date,
1357    nethost."create",
1358    nethost.ikey,
1359    nethost.exported,
1360    replace(nethost_attributes_macs.value, ':'::text, ''::text) AS name,
1361    nethost.createdby,
1362    nethost.modifiedby,
1363    nethost.expire,
1364    nethost.oalias,
1365    nethost.nodelete,
1366    nethost.internobject,
1367    nethost.oaliascache
1368   FROM (public.nethost_attributes_macs
1369     JOIN public.nethost ON ((nethost.ikey = nethost_attributes_macs.okey)))
1370  WHERE (nethost_attributes_macs.attr = 'macaddr'::text);
1371
1372
1373--
1374-- Name: macentry_attributes; Type: VIEW; Schema: public; Owner: -
1375--
1376
1377CREATE VIEW public.macentry_attributes AS
1378 SELECT nethost_attributes.value,
1379    nethost_attributes.attr_key,
1380    nethost_attributes.okey,
1381    nethost_attributes.attr
1382   FROM public.nethost_attributes;
1383
1384
1385--
1386-- Name: nethost_attributes_ips; Type: TABLE; Schema: public; Owner: -
1387--
1388
1389CREATE TABLE public.nethost_attributes_ips (
1390)
1391INHERITS (public.nethost_attributes);
1392
1393
1394--
1395-- Name: nethost_attributes_list; Type: TABLE; Schema: public; Owner: -
1396--
1397
1398CREATE TABLE public.nethost_attributes_list (
1399    ikey integer DEFAULT nextval('public.ikey_seq'::regclass),
1400    canonical text,
1401    description text
1402)
1403INHERITS (public.revisions, public.attributes_list);
1404
1405
1406--
1407-- Name: nethost_attributes_nethosts; Type: TABLE; Schema: public; Owner: -
1408--
1409
1410CREATE TABLE public.nethost_attributes_nethosts (
1411)
1412INHERITS (public.nethost_attributes);
1413
1414
1415--
1416-- Name: netzone; Type: TABLE; Schema: public; Owner: -
1417--
1418
1419CREATE TABLE public.netzone (
1420)
1421INHERITS (public.objects);
1422
1423
1424--
1425-- Name: netzone_attributes; Type: TABLE; Schema: public; Owner: -
1426--
1427
1428CREATE TABLE public.netzone_attributes (
1429)
1430INHERITS (public.attributes);
1431
1432
1433--
1434-- Name: nethost_attributes_netzone; Type: VIEW; Schema: public; Owner: -
1435--
1436
1437CREATE VIEW public.nethost_attributes_netzone AS
1438 SELECT netzone.name AS value,
1439    'netZone'::text AS attr,
1440    nethost_attributes_ips.attr_key,
1441    nethost_attributes_ips.okey
1442   FROM public.nethost_attributes_ips,
1443    public.netzone_attributes,
1444    public.netzone
1445  WHERE ((netzone.ikey = netzone_attributes.okey) AND (netzone_attributes.attr = 'net'::text) AND ((nethost_attributes_ips.value)::inet <<= (netzone_attributes.value)::inet))
1446EXCEPT
1447 SELECT netzone.name AS value,
1448    'netZone'::text AS attr,
1449    nethost_attributes_ips.attr_key,
1450    nethost_attributes_ips.okey
1451   FROM public.nethost_attributes_ips,
1452    public.netzone_attributes,
1453    public.netzone
1454  WHERE ((netzone.ikey = netzone_attributes.okey) AND (netzone_attributes.attr = 'netExclude'::text) AND ((nethost_attributes_ips.value)::inet <<= (netzone_attributes.value)::inet));
1455
1456
1457--
1458-- Name: nethost_attributes_read; Type: VIEW; Schema: public; Owner: -
1459--
1460
1461CREATE VIEW public.nethost_attributes_read AS
1462 SELECT nethost_attributes.value,
1463    nethost_attributes.attr,
1464    nethost_attributes.attr_key,
1465    nethost_attributes.okey
1466   FROM public.nethost_attributes
1467UNION
1468 SELECT nethost_attributes_netzone.value,
1469    nethost_attributes_netzone.attr,
1470    nethost_attributes_netzone.attr_key,
1471    nethost_attributes_netzone.okey
1472   FROM public.nethost_attributes_netzone;
1473
1474
1475--
1476-- Name: nethost_attributes_users; Type: TABLE; Schema: public; Owner: -
1477--
1478
1479CREATE TABLE public.nethost_attributes_users (
1480)
1481INHERITS (public.nethost_attributes);
1482
1483
1484--
1485-- Name: netzone_attributes_list; Type: TABLE; Schema: public; Owner: -
1486--
1487
1488CREATE TABLE public.netzone_attributes_list (
1489    ikey integer DEFAULT nextval('public.ikey_seq'::regclass),
1490    canonical text,
1491    description text
1492)
1493INHERITS (public.revisions, public.attributes_list);
1494
1495
1496--
1497-- Name: netzone_attributes_netzone; Type: TABLE; Schema: public; Owner: -
1498--
1499
1500CREATE TABLE public.netzone_attributes_netzone (
1501)
1502INHERITS (public.netzone_attributes);
1503
1504
1505--
1506-- Name: netzone_attributes_site; Type: TABLE; Schema: public; Owner: -
1507--
1508
1509CREATE TABLE public.netzone_attributes_site (
1510)
1511INHERITS (public.netzone_attributes);
1512
1513
1514--
1515-- Name: objectslogs; Type: TABLE; Schema: public; Owner: -
1516--
1517
1518CREATE TABLE public.objectslogs (
1519    logkey bigint NOT NULL,
1520    ikey bigint NOT NULL,
1521    otype text NOT NULL,
1522    name text NOT NULL,
1523    changetype text NOT NULL,
1524    username text NOT NULL,
1525    message text NOT NULL,
1526    logdate timestamp with time zone DEFAULT now() NOT NULL,
1527    irev bigint
1528);
1529
1530
1531--
1532-- Name: objectlogs_logkey_seq; Type: SEQUENCE; Schema: public; Owner: -
1533--
1534
1535CREATE SEQUENCE public.objectlogs_logkey_seq
1536    START WITH 1
1537    INCREMENT BY 1
1538    NO MINVALUE
1539    NO MAXVALUE
1540    CACHE 1;
1541
1542
1543--
1544-- Name: objectlogs_logkey_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1545--
1546
1547ALTER SEQUENCE public.objectlogs_logkey_seq OWNED BY public.objectslogs.logkey;
1548
1549
1550--
1551-- Name: objects_table; Type: VIEW; Schema: public; Owner: -
1552--
1553
1554CREATE VIEW public.objects_table AS
1555 SELECT objects.rev,
1556    objects.date,
1557    objects."create",
1558    objects.ikey,
1559    pg_class.relname,
1560    objects.name,
1561    objects.exported
1562   FROM (public.objects
1563     JOIN pg_class ON ((objects.tableoid = pg_class.oid)));
1564
1565
1566--
1567-- Name: passwordreset; Type: TABLE; Schema: public; Owner: -
1568--
1569
1570CREATE TABLE public.passwordreset (
1571    "user" text NOT NULL,
1572    id text NOT NULL
1573)
1574INHERITS (public.revisions);
1575
1576
1577--
1578-- Name: request; Type: TABLE; Schema: public; Owner: -
1579--
1580
1581CREATE TABLE public.request (
1582    id integer NOT NULL,
1583    "create" timestamp with time zone DEFAULT now() NOT NULL,
1584    name text NOT NULL,
1585    object text,
1586    apply timestamp with time zone DEFAULT now() NOT NULL,
1587    done timestamp with time zone,
1588    "user" text,
1589    applied boolean,
1590    reason text,
1591    automated boolean DEFAULT false NOT NULL,
1592    objrev bigint
1593);
1594
1595
1596--
1597-- Name: request_attributes; Type: TABLE; Schema: public; Owner: -
1598--
1599
1600CREATE TABLE public.request_attributes (
1601    reqid bigint,
1602    attribute text NOT NULL,
1603    value text
1604);
1605
1606
1607--
1608-- Name: request_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1609--
1610
1611CREATE SEQUENCE public.request_id_seq
1612    START WITH 1
1613    INCREMENT BY 1
1614    NO MINVALUE
1615    NO MAXVALUE
1616    CACHE 1;
1617
1618
1619--
1620-- Name: request_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1621--
1622
1623ALTER SEQUENCE public.request_id_seq OWNED BY public.request.id;
1624
1625
1626--
1627-- Name: revaliases; Type: TABLE; Schema: public; Owner: -
1628--
1629
1630CREATE TABLE public.revaliases (
1631    "as" text NOT NULL,
1632    description text
1633)
1634INHERITS (public.objects);
1635
1636
1637--
1638-- Name: revisions_table; Type: VIEW; Schema: public; Owner: -
1639--
1640
1641CREATE VIEW public.revisions_table AS
1642 SELECT revisions.rev,
1643    revisions.date,
1644    revisions."create",
1645    revisions.ikey,
1646    pg_class.relname
1647   FROM (public.revisions
1648     JOIN pg_class ON ((revisions.tableoid = pg_class.oid)));
1649
1650
1651--
1652-- Name: service; Type: TABLE; Schema: public; Owner: -
1653--
1654
1655CREATE TABLE public.service (
1656    start date,
1657    "end" date
1658)
1659INHERITS (public.objects);
1660
1661
1662--
1663-- Name: service_attributes; Type: TABLE; Schema: public; Owner: -
1664--
1665
1666CREATE TABLE public.service_attributes (
1667)
1668INHERITS (public.attributes);
1669
1670
1671--
1672-- Name: service_attributes_list; Type: TABLE; Schema: public; Owner: -
1673--
1674
1675CREATE TABLE public.service_attributes_list (
1676    ikey integer DEFAULT nextval('public.ikey_seq'::regclass),
1677    canonical text,
1678    description text
1679)
1680INHERITS (public.revisions, public.attributes_list);
1681
1682
1683--
1684-- Name: service_attributes_users; Type: TABLE; Schema: public; Owner: -
1685--
1686
1687CREATE TABLE public.service_attributes_users (
1688)
1689INHERITS (public.service_attributes);
1690
1691
1692--
1693-- Name: settings; Type: TABLE; Schema: public; Owner: -
1694--
1695
1696CREATE TABLE public.settings (
1697    varname text NOT NULL,
1698    val text
1699)
1700INHERITS (public.revisions);
1701
1702
1703--
1704-- Name: site; Type: TABLE; Schema: public; Owner: -
1705--
1706
1707CREATE TABLE public.site (
1708    name text
1709)
1710INHERITS (public.objects);
1711
1712
1713--
1714-- Name: site_attributes; Type: TABLE; Schema: public; Owner: -
1715--
1716
1717CREATE TABLE public.site_attributes (
1718)
1719INHERITS (public.attributes);
1720
1721
1722--
1723-- Name: site_attributes_list; Type: TABLE; Schema: public; Owner: -
1724--
1725
1726CREATE TABLE public.site_attributes_list (
1727)
1728INHERITS (public.revisions, public.attributes_list);
1729
1730
1731--
1732-- Name: stat; Type: TABLE; Schema: public; Owner: -
1733--
1734
1735CREATE TABLE public.stat (
1736    name text
1737)
1738INHERITS (public.objects);
1739
1740
1741--
1742-- Name: stat_attributes; Type: TABLE; Schema: public; Owner: -
1743--
1744
1745CREATE TABLE public.stat_attributes (
1746)
1747INHERITS (public.attributes);
1748
1749
1750--
1751-- Name: stat_attributes_list; Type: TABLE; Schema: public; Owner: -
1752--
1753
1754CREATE TABLE public.stat_attributes_list (
1755)
1756INHERITS (public.revisions, public.attributes_list);
1757
1758
1759--
1760-- Name: statsentry; Type: TABLE; Schema: public; Owner: -
1761--
1762
1763CREATE TABLE public.statsentry (
1764    okey integer NOT NULL,
1765    id bigint DEFAULT nextval('public.revisions_rev_seq'::regclass) NOT NULL,
1766    tstamp timestamp with time zone DEFAULT now() NOT NULL
1767);
1768
1769
1770--
1771-- Name: statvalues; Type: TABLE; Schema: public; Owner: -
1772--
1773
1774CREATE TABLE public.statvalues (
1775    sid bigint NOT NULL,
1776    value text NOT NULL,
1777    count bigint NOT NULL
1778);
1779
1780
1781--
1782-- Name: su_type; Type: TABLE; Schema: public; Owner: -
1783--
1784
1785CREATE TABLE public.su_type (
1786    name text,
1787    description text
1788)
1789INHERITS (public.objects);
1790
1791
1792--
1793-- Name: user_attributes; Type: VIEW; Schema: public; Owner: -
1794--
1795
1796CREATE VIEW public.user_attributes AS
1797 SELECT ("user".uidnumber)::text AS value,
1798    'uidnumber'::text AS attr,
1799    "user".rev AS attr_key,
1800    "user".ikey AS okey
1801   FROM public."user"
1802UNION ALL
1803 SELECT ("user".gidnumber)::text AS value,
1804    'gidnumber'::text AS attr,
1805    "user".rev AS attr_key,
1806    "user".ikey AS okey
1807   FROM public."user"
1808UNION ALL
1809 SELECT "user".name AS value,
1810    'name'::text AS attr,
1811    "user".rev AS attr_key,
1812    "user".ikey AS okey
1813   FROM public."user"
1814UNION ALL
1815 SELECT ("user".expire)::text AS value,
1816    'expire'::text AS attr,
1817    "user".rev AS attr_key,
1818    "user".ikey AS okey
1819   FROM public."user"
1820  WHERE ("user".expire IS NOT NULL)
1821UNION ALL
1822 SELECT '1'::text AS value,
1823    'exported'::text AS attr,
1824    "user".rev AS attr_key,
1825    "user".ikey AS okey
1826   FROM public."user"
1827  WHERE ("user".exported = true)
1828UNION ALL
1829 SELECT address_attributes_site.value,
1830    'allsite'::text AS attr,
1831    "user".rev AS attr_key,
1832    "user".ikey AS okey
1833   FROM ((public."user"
1834     JOIN public.address ON ((address."user" = "user".name)))
1835     JOIN public.address_attributes_site ON ((address_attributes_site.okey = address.ikey)))
1836  WHERE ((address_attributes_site.attr = 'site'::text) AND (address.exported = true))
1837UNION ALL
1838 SELECT "group".name AS value,
1839    'memberOf'::text AS attr,
1840    "user".rev AS attr_key,
1841    "user".ikey AS okey
1842   FROM ((public."user"
1843     JOIN public.group_attributes ON ((group_attributes.value = "user".name)))
1844     JOIN public."group" ON ((group_attributes.okey = "group".ikey)))
1845  WHERE (group_attributes.attr = 'memberUID'::text)
1846UNION ALL
1847 SELECT user_attributes.value,
1848    user_attributes.attr,
1849    user_attributes.attr_key,
1850    user_attributes.okey
1851   FROM public.user_attributes_base user_attributes
1852UNION ALL
1853 SELECT "group".name AS value,
1854    'departments'::text AS attr,
1855    "user".rev AS attr_key,
1856    "user".ikey AS okey
1857   FROM (((public."group"
1858     JOIN public.group_attributes_sutypes ON (("group".ikey = group_attributes_sutypes.okey)))
1859     JOIN public.group_attributes_users ON ((("group".ikey = group_attributes_users.okey) AND (group_attributes_users.attr = 'memberUID'::text))))
1860     JOIN public."user" ON (("user".name = group_attributes_users.value)))
1861  WHERE ((group_attributes_sutypes.value = 'dpmt'::text) AND (group_attributes_sutypes.attr = 'sutype'::text))
1862UNION ALL
1863 SELECT "group".name AS value,
1864    'cells'::text AS attr,
1865    "user".rev AS attr_key,
1866    "user".ikey AS okey
1867   FROM (((public."group"
1868     JOIN public.group_attributes_sutypes ON (("group".ikey = group_attributes_sutypes.okey)))
1869     JOIN public.group_attributes_users ON ((("group".ikey = group_attributes_users.okey) AND (group_attributes_users.attr = 'memberUID'::text))))
1870     JOIN public."user" ON (("user".name = group_attributes_users.value)))
1871  WHERE ((group_attributes_sutypes.value = 'cell'::text) AND (group_attributes_sutypes.attr = 'sutype'::text))
1872UNION ALL
1873 SELECT "group".name AS value,
1874    'managedObjects'::text AS attr,
1875    "user".rev AS attr_key,
1876    "user".ikey AS okey
1877   FROM ((public."user"
1878     JOIN public.group_attributes ON ((group_attributes.value = "user".name)))
1879     JOIN public."group" ON ((group_attributes.okey = "group".ikey)))
1880  WHERE (group_attributes.attr = 'managedBy'::text)
1881UNION ALL
1882 SELECT (justify_interval((now() - "user".expire)))::text AS value,
1883    'expired'::text AS attr,
1884    "user".rev AS attr_key,
1885    "user".ikey AS okey
1886   FROM public."user"
1887  WHERE ("user".expire <= now())
1888UNION ALL
1889 SELECT (1)::text AS value,
1890    'active'::text AS attr,
1891    "user".rev AS attr_key,
1892    "user".ikey AS okey
1893   FROM public."user"
1894  WHERE ((("user".expire IS NULL) OR ("user".expire >= now())) AND ("user".exported = true))
1895UNION ALL
1896 SELECT (0)::text AS value,
1897    'active'::text AS attr,
1898    "user".rev AS attr_key,
1899    "user".ikey AS okey
1900   FROM public."user"
1901  WHERE ((("user".expire IS NOT NULL) AND ("user".expire <= now())) OR ("user".exported = false));
1902
1903
1904--
1905-- Name: user_attributes_groups; Type: TABLE; Schema: public; Owner: -
1906--
1907
1908CREATE TABLE public.user_attributes_groups (
1909)
1910INHERITS (public.user_attributes_base);
1911
1912
1913--
1914-- Name: user_attributes_list; Type: TABLE; Schema: public; Owner: -
1915--
1916
1917CREATE TABLE public.user_attributes_list (
1918)
1919INHERITS (public.revisions, public.attributes_list);
1920
1921
1922--
1923-- Name: user_attributes_site; Type: TABLE; Schema: public; Owner: -
1924--
1925
1926CREATE TABLE public.user_attributes_site (
1927)
1928INHERITS (public.user_attributes_base);
1929
1930
1931--
1932-- Name: user_attributes_users; Type: TABLE; Schema: public; Owner: -
1933--
1934
1935CREATE TABLE public.user_attributes_users (
1936)
1937INHERITS (public.user_attributes_base);
1938
1939
1940--
1941-- Name: accreq rev; Type: DEFAULT; Schema: public; Owner: -
1942--
1943
1944ALTER TABLE ONLY public.accreq ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
1945
1946
1947--
1948-- Name: accreq date; Type: DEFAULT; Schema: public; Owner: -
1949--
1950
1951ALTER TABLE ONLY public.accreq ALTER COLUMN date SET DEFAULT now();
1952
1953
1954--
1955-- Name: accreq create; Type: DEFAULT; Schema: public; Owner: -
1956--
1957
1958ALTER TABLE ONLY public.accreq ALTER COLUMN "create" SET DEFAULT now();
1959
1960
1961--
1962-- Name: accreq ikey; Type: DEFAULT; Schema: public; Owner: -
1963--
1964
1965ALTER TABLE ONLY public.accreq ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
1966
1967
1968--
1969-- Name: accreq exported; Type: DEFAULT; Schema: public; Owner: -
1970--
1971
1972ALTER TABLE ONLY public.accreq ALTER COLUMN exported SET DEFAULT true;
1973
1974
1975--
1976-- Name: accreq internobject; Type: DEFAULT; Schema: public; Owner: -
1977--
1978
1979ALTER TABLE ONLY public.accreq ALTER COLUMN internobject SET DEFAULT false;
1980
1981
1982--
1983-- Name: accreq nodelete; Type: DEFAULT; Schema: public; Owner: -
1984--
1985
1986ALTER TABLE ONLY public.accreq ALTER COLUMN nodelete SET DEFAULT false;
1987
1988
1989--
1990-- Name: accreq_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
1991--
1992
1993ALTER TABLE ONLY public.accreq_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
1994
1995
1996--
1997-- Name: address rev; Type: DEFAULT; Schema: public; Owner: -
1998--
1999
2000ALTER TABLE ONLY public.address ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2001
2002
2003--
2004-- Name: address date; Type: DEFAULT; Schema: public; Owner: -
2005--
2006
2007ALTER TABLE ONLY public.address ALTER COLUMN date SET DEFAULT now();
2008
2009
2010--
2011-- Name: address create; Type: DEFAULT; Schema: public; Owner: -
2012--
2013
2014ALTER TABLE ONLY public.address ALTER COLUMN "create" SET DEFAULT now();
2015
2016
2017--
2018-- Name: address ikey; Type: DEFAULT; Schema: public; Owner: -
2019--
2020
2021ALTER TABLE ONLY public.address ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2022
2023
2024--
2025-- Name: address exported; Type: DEFAULT; Schema: public; Owner: -
2026--
2027
2028ALTER TABLE ONLY public.address ALTER COLUMN exported SET DEFAULT true;
2029
2030
2031--
2032-- Name: address internobject; Type: DEFAULT; Schema: public; Owner: -
2033--
2034
2035ALTER TABLE ONLY public.address ALTER COLUMN internobject SET DEFAULT false;
2036
2037
2038--
2039-- Name: address nodelete; Type: DEFAULT; Schema: public; Owner: -
2040--
2041
2042ALTER TABLE ONLY public.address ALTER COLUMN nodelete SET DEFAULT false;
2043
2044
2045--
2046-- Name: address_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2047--
2048
2049ALTER TABLE ONLY public.address_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2050
2051
2052--
2053-- Name: address_attributes_base attr_key; Type: DEFAULT; Schema: public; Owner: -
2054--
2055
2056ALTER TABLE ONLY public.address_attributes_base ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2057
2058
2059--
2060-- Name: address_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
2061--
2062
2063ALTER TABLE ONLY public.address_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2064
2065
2066--
2067-- Name: address_attributes_list_site ikey; Type: DEFAULT; Schema: public; Owner: -
2068--
2069
2070ALTER TABLE ONLY public.address_attributes_list_site ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2071
2072
2073--
2074-- Name: address_attributes_list_site rev; Type: DEFAULT; Schema: public; Owner: -
2075--
2076
2077ALTER TABLE ONLY public.address_attributes_list_site ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2078
2079
2080--
2081-- Name: address_attributes_list_site date; Type: DEFAULT; Schema: public; Owner: -
2082--
2083
2084ALTER TABLE ONLY public.address_attributes_list_site ALTER COLUMN date SET DEFAULT now();
2085
2086
2087--
2088-- Name: address_attributes_list_site create; Type: DEFAULT; Schema: public; Owner: -
2089--
2090
2091ALTER TABLE ONLY public.address_attributes_list_site ALTER COLUMN "create" SET DEFAULT now();
2092
2093
2094--
2095-- Name: address_attributes_site attr_key; Type: DEFAULT; Schema: public; Owner: -
2096--
2097
2098ALTER TABLE ONLY public.address_attributes_site ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2099
2100
2101--
2102-- Name: aliases rev; Type: DEFAULT; Schema: public; Owner: -
2103--
2104
2105ALTER TABLE ONLY public.aliases ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2106
2107
2108--
2109-- Name: aliases date; Type: DEFAULT; Schema: public; Owner: -
2110--
2111
2112ALTER TABLE ONLY public.aliases ALTER COLUMN date SET DEFAULT now();
2113
2114
2115--
2116-- Name: aliases create; Type: DEFAULT; Schema: public; Owner: -
2117--
2118
2119ALTER TABLE ONLY public.aliases ALTER COLUMN "create" SET DEFAULT now();
2120
2121
2122--
2123-- Name: aliases ikey; Type: DEFAULT; Schema: public; Owner: -
2124--
2125
2126ALTER TABLE ONLY public.aliases ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2127
2128
2129--
2130-- Name: aliases exported; Type: DEFAULT; Schema: public; Owner: -
2131--
2132
2133ALTER TABLE ONLY public.aliases ALTER COLUMN exported SET DEFAULT true;
2134
2135
2136--
2137-- Name: aliases internobject; Type: DEFAULT; Schema: public; Owner: -
2138--
2139
2140ALTER TABLE ONLY public.aliases ALTER COLUMN internobject SET DEFAULT false;
2141
2142
2143--
2144-- Name: aliases nodelete; Type: DEFAULT; Schema: public; Owner: -
2145--
2146
2147ALTER TABLE ONLY public.aliases ALTER COLUMN nodelete SET DEFAULT false;
2148
2149
2150--
2151-- Name: aliases_attributes_base attr_key; Type: DEFAULT; Schema: public; Owner: -
2152--
2153
2154ALTER TABLE ONLY public.aliases_attributes_base ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2155
2156
2157--
2158-- Name: aliases_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2159--
2160
2161ALTER TABLE ONLY public.aliases_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2162
2163
2164--
2165-- Name: aliases_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2166--
2167
2168ALTER TABLE ONLY public.aliases_attributes_list ALTER COLUMN date SET DEFAULT now();
2169
2170
2171--
2172-- Name: aliases_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2173--
2174
2175ALTER TABLE ONLY public.aliases_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2176
2177
2178--
2179-- Name: attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2180--
2181
2182ALTER TABLE ONLY public.attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2183
2184
2185--
2186-- Name: attributes_values rev; Type: DEFAULT; Schema: public; Owner: -
2187--
2188
2189ALTER TABLE ONLY public.attributes_values ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2190
2191
2192--
2193-- Name: attributes_values date; Type: DEFAULT; Schema: public; Owner: -
2194--
2195
2196ALTER TABLE ONLY public.attributes_values ALTER COLUMN date SET DEFAULT now();
2197
2198
2199--
2200-- Name: attributes_values create; Type: DEFAULT; Schema: public; Owner: -
2201--
2202
2203ALTER TABLE ONLY public.attributes_values ALTER COLUMN "create" SET DEFAULT now();
2204
2205
2206--
2207-- Name: attributes_values ikey; Type: DEFAULT; Schema: public; Owner: -
2208--
2209
2210ALTER TABLE ONLY public.attributes_values ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2211
2212
2213--
2214-- Name: employment rev; Type: DEFAULT; Schema: public; Owner: -
2215--
2216
2217ALTER TABLE ONLY public.employment ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2218
2219
2220--
2221-- Name: employment date; Type: DEFAULT; Schema: public; Owner: -
2222--
2223
2224ALTER TABLE ONLY public.employment ALTER COLUMN date SET DEFAULT now();
2225
2226
2227--
2228-- Name: employment create; Type: DEFAULT; Schema: public; Owner: -
2229--
2230
2231ALTER TABLE ONLY public.employment ALTER COLUMN "create" SET DEFAULT now();
2232
2233
2234--
2235-- Name: employment ikey; Type: DEFAULT; Schema: public; Owner: -
2236--
2237
2238ALTER TABLE ONLY public.employment ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2239
2240
2241--
2242-- Name: employment exported; Type: DEFAULT; Schema: public; Owner: -
2243--
2244
2245ALTER TABLE ONLY public.employment ALTER COLUMN exported SET DEFAULT true;
2246
2247
2248--
2249-- Name: employment internobject; Type: DEFAULT; Schema: public; Owner: -
2250--
2251
2252ALTER TABLE ONLY public.employment ALTER COLUMN internobject SET DEFAULT false;
2253
2254
2255--
2256-- Name: employment nodelete; Type: DEFAULT; Schema: public; Owner: -
2257--
2258
2259ALTER TABLE ONLY public.employment ALTER COLUMN nodelete SET DEFAULT false;
2260
2261
2262--
2263-- Name: employment_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2264--
2265
2266ALTER TABLE ONLY public.employment_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2267
2268
2269--
2270-- Name: employment_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2271--
2272
2273ALTER TABLE ONLY public.employment_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2274
2275
2276--
2277-- Name: employment_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2278--
2279
2280ALTER TABLE ONLY public.employment_attributes_list ALTER COLUMN date SET DEFAULT now();
2281
2282
2283--
2284-- Name: employment_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2285--
2286
2287ALTER TABLE ONLY public.employment_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2288
2289
2290--
2291-- Name: employment_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
2292--
2293
2294ALTER TABLE ONLY public.employment_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2295
2296
2297--
2298-- Name: group rev; Type: DEFAULT; Schema: public; Owner: -
2299--
2300
2301ALTER TABLE ONLY public."group" ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2302
2303
2304--
2305-- Name: group date; Type: DEFAULT; Schema: public; Owner: -
2306--
2307
2308ALTER TABLE ONLY public."group" ALTER COLUMN date SET DEFAULT now();
2309
2310
2311--
2312-- Name: group create; Type: DEFAULT; Schema: public; Owner: -
2313--
2314
2315ALTER TABLE ONLY public."group" ALTER COLUMN "create" SET DEFAULT now();
2316
2317
2318--
2319-- Name: group ikey; Type: DEFAULT; Schema: public; Owner: -
2320--
2321
2322ALTER TABLE ONLY public."group" ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2323
2324
2325--
2326-- Name: group exported; Type: DEFAULT; Schema: public; Owner: -
2327--
2328
2329ALTER TABLE ONLY public."group" ALTER COLUMN exported SET DEFAULT true;
2330
2331
2332--
2333-- Name: group internobject; Type: DEFAULT; Schema: public; Owner: -
2334--
2335
2336ALTER TABLE ONLY public."group" ALTER COLUMN internobject SET DEFAULT false;
2337
2338
2339--
2340-- Name: group nodelete; Type: DEFAULT; Schema: public; Owner: -
2341--
2342
2343ALTER TABLE ONLY public."group" ALTER COLUMN nodelete SET DEFAULT false;
2344
2345
2346--
2347-- Name: group_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2348--
2349
2350ALTER TABLE ONLY public.group_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2351
2352
2353--
2354-- Name: group_attributes_base attr_key; Type: DEFAULT; Schema: public; Owner: -
2355--
2356
2357ALTER TABLE ONLY public.group_attributes_base ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2358
2359
2360--
2361-- Name: group_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2362--
2363
2364ALTER TABLE ONLY public.group_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2365
2366
2367--
2368-- Name: group_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2369--
2370
2371ALTER TABLE ONLY public.group_attributes_list ALTER COLUMN date SET DEFAULT now();
2372
2373
2374--
2375-- Name: group_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2376--
2377
2378ALTER TABLE ONLY public.group_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2379
2380
2381--
2382-- Name: group_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
2383--
2384
2385ALTER TABLE ONLY public.group_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2386
2387
2388--
2389-- Name: group_attributes_sutypes attr_key; Type: DEFAULT; Schema: public; Owner: -
2390--
2391
2392ALTER TABLE ONLY public.group_attributes_sutypes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2393
2394
2395--
2396-- Name: group_attributes_users attr_key; Type: DEFAULT; Schema: public; Owner: -
2397--
2398
2399ALTER TABLE ONLY public.group_attributes_users ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2400
2401
2402--
2403-- Name: nethost rev; Type: DEFAULT; Schema: public; Owner: -
2404--
2405
2406ALTER TABLE ONLY public.nethost ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2407
2408
2409--
2410-- Name: nethost date; Type: DEFAULT; Schema: public; Owner: -
2411--
2412
2413ALTER TABLE ONLY public.nethost ALTER COLUMN date SET DEFAULT now();
2414
2415
2416--
2417-- Name: nethost create; Type: DEFAULT; Schema: public; Owner: -
2418--
2419
2420ALTER TABLE ONLY public.nethost ALTER COLUMN "create" SET DEFAULT now();
2421
2422
2423--
2424-- Name: nethost ikey; Type: DEFAULT; Schema: public; Owner: -
2425--
2426
2427ALTER TABLE ONLY public.nethost ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2428
2429
2430--
2431-- Name: nethost exported; Type: DEFAULT; Schema: public; Owner: -
2432--
2433
2434ALTER TABLE ONLY public.nethost ALTER COLUMN exported SET DEFAULT true;
2435
2436
2437--
2438-- Name: nethost internobject; Type: DEFAULT; Schema: public; Owner: -
2439--
2440
2441ALTER TABLE ONLY public.nethost ALTER COLUMN internobject SET DEFAULT false;
2442
2443
2444--
2445-- Name: nethost nodelete; Type: DEFAULT; Schema: public; Owner: -
2446--
2447
2448ALTER TABLE ONLY public.nethost ALTER COLUMN nodelete SET DEFAULT false;
2449
2450
2451--
2452-- Name: nethost_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2453--
2454
2455ALTER TABLE ONLY public.nethost_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2456
2457
2458--
2459-- Name: nethost_attributes_ips attr_key; Type: DEFAULT; Schema: public; Owner: -
2460--
2461
2462ALTER TABLE ONLY public.nethost_attributes_ips ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2463
2464
2465--
2466-- Name: nethost_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2467--
2468
2469ALTER TABLE ONLY public.nethost_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2470
2471
2472--
2473-- Name: nethost_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2474--
2475
2476ALTER TABLE ONLY public.nethost_attributes_list ALTER COLUMN date SET DEFAULT now();
2477
2478
2479--
2480-- Name: nethost_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2481--
2482
2483ALTER TABLE ONLY public.nethost_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2484
2485
2486--
2487-- Name: nethost_attributes_macs attr_key; Type: DEFAULT; Schema: public; Owner: -
2488--
2489
2490ALTER TABLE ONLY public.nethost_attributes_macs ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2491
2492
2493--
2494-- Name: nethost_attributes_nethosts attr_key; Type: DEFAULT; Schema: public; Owner: -
2495--
2496
2497ALTER TABLE ONLY public.nethost_attributes_nethosts ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2498
2499
2500--
2501-- Name: nethost_attributes_users attr_key; Type: DEFAULT; Schema: public; Owner: -
2502--
2503
2504ALTER TABLE ONLY public.nethost_attributes_users ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2505
2506
2507--
2508-- Name: netzone rev; Type: DEFAULT; Schema: public; Owner: -
2509--
2510
2511ALTER TABLE ONLY public.netzone ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2512
2513
2514--
2515-- Name: netzone date; Type: DEFAULT; Schema: public; Owner: -
2516--
2517
2518ALTER TABLE ONLY public.netzone ALTER COLUMN date SET DEFAULT now();
2519
2520
2521--
2522-- Name: netzone create; Type: DEFAULT; Schema: public; Owner: -
2523--
2524
2525ALTER TABLE ONLY public.netzone ALTER COLUMN "create" SET DEFAULT now();
2526
2527
2528--
2529-- Name: netzone ikey; Type: DEFAULT; Schema: public; Owner: -
2530--
2531
2532ALTER TABLE ONLY public.netzone ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2533
2534
2535--
2536-- Name: netzone exported; Type: DEFAULT; Schema: public; Owner: -
2537--
2538
2539ALTER TABLE ONLY public.netzone ALTER COLUMN exported SET DEFAULT true;
2540
2541
2542--
2543-- Name: netzone internobject; Type: DEFAULT; Schema: public; Owner: -
2544--
2545
2546ALTER TABLE ONLY public.netzone ALTER COLUMN internobject SET DEFAULT false;
2547
2548
2549--
2550-- Name: netzone nodelete; Type: DEFAULT; Schema: public; Owner: -
2551--
2552
2553ALTER TABLE ONLY public.netzone ALTER COLUMN nodelete SET DEFAULT false;
2554
2555
2556--
2557-- Name: netzone_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2558--
2559
2560ALTER TABLE ONLY public.netzone_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2561
2562
2563--
2564-- Name: netzone_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2565--
2566
2567ALTER TABLE ONLY public.netzone_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2568
2569
2570--
2571-- Name: netzone_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2572--
2573
2574ALTER TABLE ONLY public.netzone_attributes_list ALTER COLUMN date SET DEFAULT now();
2575
2576
2577--
2578-- Name: netzone_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2579--
2580
2581ALTER TABLE ONLY public.netzone_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2582
2583
2584--
2585-- Name: netzone_attributes_netzone attr_key; Type: DEFAULT; Schema: public; Owner: -
2586--
2587
2588ALTER TABLE ONLY public.netzone_attributes_netzone ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2589
2590
2591--
2592-- Name: netzone_attributes_site attr_key; Type: DEFAULT; Schema: public; Owner: -
2593--
2594
2595ALTER TABLE ONLY public.netzone_attributes_site ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2596
2597
2598--
2599-- Name: objects rev; Type: DEFAULT; Schema: public; Owner: -
2600--
2601
2602ALTER TABLE ONLY public.objects ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2603
2604
2605--
2606-- Name: objects date; Type: DEFAULT; Schema: public; Owner: -
2607--
2608
2609ALTER TABLE ONLY public.objects ALTER COLUMN date SET DEFAULT now();
2610
2611
2612--
2613-- Name: objects create; Type: DEFAULT; Schema: public; Owner: -
2614--
2615
2616ALTER TABLE ONLY public.objects ALTER COLUMN "create" SET DEFAULT now();
2617
2618
2619--
2620-- Name: objects ikey; Type: DEFAULT; Schema: public; Owner: -
2621--
2622
2623ALTER TABLE ONLY public.objects ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2624
2625
2626--
2627-- Name: objectslogs logkey; Type: DEFAULT; Schema: public; Owner: -
2628--
2629
2630ALTER TABLE ONLY public.objectslogs ALTER COLUMN logkey SET DEFAULT nextval('public.objectlogs_logkey_seq'::regclass);
2631
2632
2633--
2634-- Name: passwordreset rev; Type: DEFAULT; Schema: public; Owner: -
2635--
2636
2637ALTER TABLE ONLY public.passwordreset ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2638
2639
2640--
2641-- Name: passwordreset date; Type: DEFAULT; Schema: public; Owner: -
2642--
2643
2644ALTER TABLE ONLY public.passwordreset ALTER COLUMN date SET DEFAULT now();
2645
2646
2647--
2648-- Name: passwordreset create; Type: DEFAULT; Schema: public; Owner: -
2649--
2650
2651ALTER TABLE ONLY public.passwordreset ALTER COLUMN "create" SET DEFAULT now();
2652
2653
2654--
2655-- Name: passwordreset ikey; Type: DEFAULT; Schema: public; Owner: -
2656--
2657
2658ALTER TABLE ONLY public.passwordreset ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2659
2660
2661--
2662-- Name: request id; Type: DEFAULT; Schema: public; Owner: -
2663--
2664
2665ALTER TABLE ONLY public.request ALTER COLUMN id SET DEFAULT nextval('public.request_id_seq'::regclass);
2666
2667
2668--
2669-- Name: revaliases rev; Type: DEFAULT; Schema: public; Owner: -
2670--
2671
2672ALTER TABLE ONLY public.revaliases ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2673
2674
2675--
2676-- Name: revaliases date; Type: DEFAULT; Schema: public; Owner: -
2677--
2678
2679ALTER TABLE ONLY public.revaliases ALTER COLUMN date SET DEFAULT now();
2680
2681
2682--
2683-- Name: revaliases create; Type: DEFAULT; Schema: public; Owner: -
2684--
2685
2686ALTER TABLE ONLY public.revaliases ALTER COLUMN "create" SET DEFAULT now();
2687
2688
2689--
2690-- Name: revaliases ikey; Type: DEFAULT; Schema: public; Owner: -
2691--
2692
2693ALTER TABLE ONLY public.revaliases ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2694
2695
2696--
2697-- Name: revaliases exported; Type: DEFAULT; Schema: public; Owner: -
2698--
2699
2700ALTER TABLE ONLY public.revaliases ALTER COLUMN exported SET DEFAULT true;
2701
2702
2703--
2704-- Name: revaliases internobject; Type: DEFAULT; Schema: public; Owner: -
2705--
2706
2707ALTER TABLE ONLY public.revaliases ALTER COLUMN internobject SET DEFAULT false;
2708
2709
2710--
2711-- Name: revaliases nodelete; Type: DEFAULT; Schema: public; Owner: -
2712--
2713
2714ALTER TABLE ONLY public.revaliases ALTER COLUMN nodelete SET DEFAULT false;
2715
2716
2717--
2718-- Name: revisions rev; Type: DEFAULT; Schema: public; Owner: -
2719--
2720
2721ALTER TABLE ONLY public.revisions ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2722
2723
2724--
2725-- Name: service rev; Type: DEFAULT; Schema: public; Owner: -
2726--
2727
2728ALTER TABLE ONLY public.service ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2729
2730
2731--
2732-- Name: service date; Type: DEFAULT; Schema: public; Owner: -
2733--
2734
2735ALTER TABLE ONLY public.service ALTER COLUMN date SET DEFAULT now();
2736
2737
2738--
2739-- Name: service create; Type: DEFAULT; Schema: public; Owner: -
2740--
2741
2742ALTER TABLE ONLY public.service ALTER COLUMN "create" SET DEFAULT now();
2743
2744
2745--
2746-- Name: service ikey; Type: DEFAULT; Schema: public; Owner: -
2747--
2748
2749ALTER TABLE ONLY public.service ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2750
2751
2752--
2753-- Name: service exported; Type: DEFAULT; Schema: public; Owner: -
2754--
2755
2756ALTER TABLE ONLY public.service ALTER COLUMN exported SET DEFAULT true;
2757
2758
2759--
2760-- Name: service internobject; Type: DEFAULT; Schema: public; Owner: -
2761--
2762
2763ALTER TABLE ONLY public.service ALTER COLUMN internobject SET DEFAULT false;
2764
2765
2766--
2767-- Name: service nodelete; Type: DEFAULT; Schema: public; Owner: -
2768--
2769
2770ALTER TABLE ONLY public.service ALTER COLUMN nodelete SET DEFAULT false;
2771
2772
2773--
2774-- Name: service_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2775--
2776
2777ALTER TABLE ONLY public.service_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2778
2779
2780--
2781-- Name: service_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2782--
2783
2784ALTER TABLE ONLY public.service_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2785
2786
2787--
2788-- Name: service_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2789--
2790
2791ALTER TABLE ONLY public.service_attributes_list ALTER COLUMN date SET DEFAULT now();
2792
2793
2794--
2795-- Name: service_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2796--
2797
2798ALTER TABLE ONLY public.service_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2799
2800
2801--
2802-- Name: service_attributes_users attr_key; Type: DEFAULT; Schema: public; Owner: -
2803--
2804
2805ALTER TABLE ONLY public.service_attributes_users ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2806
2807
2808--
2809-- Name: settings rev; Type: DEFAULT; Schema: public; Owner: -
2810--
2811
2812ALTER TABLE ONLY public.settings ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2813
2814
2815--
2816-- Name: settings date; Type: DEFAULT; Schema: public; Owner: -
2817--
2818
2819ALTER TABLE ONLY public.settings ALTER COLUMN date SET DEFAULT now();
2820
2821
2822--
2823-- Name: settings create; Type: DEFAULT; Schema: public; Owner: -
2824--
2825
2826ALTER TABLE ONLY public.settings ALTER COLUMN "create" SET DEFAULT now();
2827
2828
2829--
2830-- Name: settings ikey; Type: DEFAULT; Schema: public; Owner: -
2831--
2832
2833ALTER TABLE ONLY public.settings ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2834
2835
2836--
2837-- Name: site rev; Type: DEFAULT; Schema: public; Owner: -
2838--
2839
2840ALTER TABLE ONLY public.site ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2841
2842
2843--
2844-- Name: site date; Type: DEFAULT; Schema: public; Owner: -
2845--
2846
2847ALTER TABLE ONLY public.site ALTER COLUMN date SET DEFAULT now();
2848
2849
2850--
2851-- Name: site create; Type: DEFAULT; Schema: public; Owner: -
2852--
2853
2854ALTER TABLE ONLY public.site ALTER COLUMN "create" SET DEFAULT now();
2855
2856
2857--
2858-- Name: site ikey; Type: DEFAULT; Schema: public; Owner: -
2859--
2860
2861ALTER TABLE ONLY public.site ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2862
2863
2864--
2865-- Name: site exported; Type: DEFAULT; Schema: public; Owner: -
2866--
2867
2868ALTER TABLE ONLY public.site ALTER COLUMN exported SET DEFAULT true;
2869
2870
2871--
2872-- Name: site internobject; Type: DEFAULT; Schema: public; Owner: -
2873--
2874
2875ALTER TABLE ONLY public.site ALTER COLUMN internobject SET DEFAULT false;
2876
2877
2878--
2879-- Name: site nodelete; Type: DEFAULT; Schema: public; Owner: -
2880--
2881
2882ALTER TABLE ONLY public.site ALTER COLUMN nodelete SET DEFAULT false;
2883
2884
2885--
2886-- Name: site_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2887--
2888
2889ALTER TABLE ONLY public.site_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2890
2891
2892--
2893-- Name: site_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2894--
2895
2896ALTER TABLE ONLY public.site_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2897
2898
2899--
2900-- Name: site_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2901--
2902
2903ALTER TABLE ONLY public.site_attributes_list ALTER COLUMN date SET DEFAULT now();
2904
2905
2906--
2907-- Name: site_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2908--
2909
2910ALTER TABLE ONLY public.site_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2911
2912
2913--
2914-- Name: site_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
2915--
2916
2917ALTER TABLE ONLY public.site_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2918
2919
2920--
2921-- Name: stat rev; Type: DEFAULT; Schema: public; Owner: -
2922--
2923
2924ALTER TABLE ONLY public.stat ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2925
2926
2927--
2928-- Name: stat date; Type: DEFAULT; Schema: public; Owner: -
2929--
2930
2931ALTER TABLE ONLY public.stat ALTER COLUMN date SET DEFAULT now();
2932
2933
2934--
2935-- Name: stat create; Type: DEFAULT; Schema: public; Owner: -
2936--
2937
2938ALTER TABLE ONLY public.stat ALTER COLUMN "create" SET DEFAULT now();
2939
2940
2941--
2942-- Name: stat ikey; Type: DEFAULT; Schema: public; Owner: -
2943--
2944
2945ALTER TABLE ONLY public.stat ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
2946
2947
2948--
2949-- Name: stat exported; Type: DEFAULT; Schema: public; Owner: -
2950--
2951
2952ALTER TABLE ONLY public.stat ALTER COLUMN exported SET DEFAULT true;
2953
2954
2955--
2956-- Name: stat internobject; Type: DEFAULT; Schema: public; Owner: -
2957--
2958
2959ALTER TABLE ONLY public.stat ALTER COLUMN internobject SET DEFAULT false;
2960
2961
2962--
2963-- Name: stat nodelete; Type: DEFAULT; Schema: public; Owner: -
2964--
2965
2966ALTER TABLE ONLY public.stat ALTER COLUMN nodelete SET DEFAULT false;
2967
2968
2969--
2970-- Name: stat_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
2971--
2972
2973ALTER TABLE ONLY public.stat_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
2974
2975
2976--
2977-- Name: stat_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
2978--
2979
2980ALTER TABLE ONLY public.stat_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
2981
2982
2983--
2984-- Name: stat_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
2985--
2986
2987ALTER TABLE ONLY public.stat_attributes_list ALTER COLUMN date SET DEFAULT now();
2988
2989
2990--
2991-- Name: stat_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
2992--
2993
2994ALTER TABLE ONLY public.stat_attributes_list ALTER COLUMN "create" SET DEFAULT now();
2995
2996
2997--
2998-- Name: stat_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
2999--
3000
3001ALTER TABLE ONLY public.stat_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
3002
3003
3004--
3005-- Name: su_type rev; Type: DEFAULT; Schema: public; Owner: -
3006--
3007
3008ALTER TABLE ONLY public.su_type ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
3009
3010
3011--
3012-- Name: su_type date; Type: DEFAULT; Schema: public; Owner: -
3013--
3014
3015ALTER TABLE ONLY public.su_type ALTER COLUMN date SET DEFAULT now();
3016
3017
3018--
3019-- Name: su_type create; Type: DEFAULT; Schema: public; Owner: -
3020--
3021
3022ALTER TABLE ONLY public.su_type ALTER COLUMN "create" SET DEFAULT now();
3023
3024
3025--
3026-- Name: su_type ikey; Type: DEFAULT; Schema: public; Owner: -
3027--
3028
3029ALTER TABLE ONLY public.su_type ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
3030
3031
3032--
3033-- Name: su_type exported; Type: DEFAULT; Schema: public; Owner: -
3034--
3035
3036ALTER TABLE ONLY public.su_type ALTER COLUMN exported SET DEFAULT true;
3037
3038
3039--
3040-- Name: su_type internobject; Type: DEFAULT; Schema: public; Owner: -
3041--
3042
3043ALTER TABLE ONLY public.su_type ALTER COLUMN internobject SET DEFAULT false;
3044
3045
3046--
3047-- Name: su_type nodelete; Type: DEFAULT; Schema: public; Owner: -
3048--
3049
3050ALTER TABLE ONLY public.su_type ALTER COLUMN nodelete SET DEFAULT false;
3051
3052
3053--
3054-- Name: user rev; Type: DEFAULT; Schema: public; Owner: -
3055--
3056
3057ALTER TABLE ONLY public."user" ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
3058
3059
3060--
3061-- Name: user date; Type: DEFAULT; Schema: public; Owner: -
3062--
3063
3064ALTER TABLE ONLY public."user" ALTER COLUMN date SET DEFAULT now();
3065
3066
3067--
3068-- Name: user create; Type: DEFAULT; Schema: public; Owner: -
3069--
3070
3071ALTER TABLE ONLY public."user" ALTER COLUMN "create" SET DEFAULT now();
3072
3073
3074--
3075-- Name: user ikey; Type: DEFAULT; Schema: public; Owner: -
3076--
3077
3078ALTER TABLE ONLY public."user" ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
3079
3080
3081--
3082-- Name: user exported; Type: DEFAULT; Schema: public; Owner: -
3083--
3084
3085ALTER TABLE ONLY public."user" ALTER COLUMN exported SET DEFAULT true;
3086
3087
3088--
3089-- Name: user internobject; Type: DEFAULT; Schema: public; Owner: -
3090--
3091
3092ALTER TABLE ONLY public."user" ALTER COLUMN internobject SET DEFAULT false;
3093
3094
3095--
3096-- Name: user nodelete; Type: DEFAULT; Schema: public; Owner: -
3097--
3098
3099ALTER TABLE ONLY public."user" ALTER COLUMN nodelete SET DEFAULT false;
3100
3101
3102--
3103-- Name: user_attributes attr_key; Type: DEFAULT; Schema: public; Owner: -
3104--
3105
3106ALTER TABLE ONLY public.user_attributes ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
3107
3108
3109--
3110-- Name: user_attributes_base attr_key; Type: DEFAULT; Schema: public; Owner: -
3111--
3112
3113ALTER TABLE ONLY public.user_attributes_base ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
3114
3115
3116--
3117-- Name: user_attributes_groups attr_key; Type: DEFAULT; Schema: public; Owner: -
3118--
3119
3120ALTER TABLE ONLY public.user_attributes_groups ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
3121
3122
3123--
3124-- Name: user_attributes_list rev; Type: DEFAULT; Schema: public; Owner: -
3125--
3126
3127ALTER TABLE ONLY public.user_attributes_list ALTER COLUMN rev SET DEFAULT nextval('public.revisions_rev_seq'::regclass);
3128
3129
3130--
3131-- Name: user_attributes_list date; Type: DEFAULT; Schema: public; Owner: -
3132--
3133
3134ALTER TABLE ONLY public.user_attributes_list ALTER COLUMN date SET DEFAULT now();
3135
3136
3137--
3138-- Name: user_attributes_list create; Type: DEFAULT; Schema: public; Owner: -
3139--
3140
3141ALTER TABLE ONLY public.user_attributes_list ALTER COLUMN "create" SET DEFAULT now();
3142
3143
3144--
3145-- Name: user_attributes_list ikey; Type: DEFAULT; Schema: public; Owner: -
3146--
3147
3148ALTER TABLE ONLY public.user_attributes_list ALTER COLUMN ikey SET DEFAULT nextval('public.ikey_seq'::regclass);
3149
3150
3151--
3152-- Name: user_attributes_site attr_key; Type: DEFAULT; Schema: public; Owner: -
3153--
3154
3155ALTER TABLE ONLY public.user_attributes_site ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
3156
3157
3158--
3159-- Name: user_attributes_users attr_key; Type: DEFAULT; Schema: public; Owner: -
3160--
3161
3162ALTER TABLE ONLY public.user_attributes_users ALTER COLUMN attr_key SET DEFAULT nextval('public.attributes_attr_key_seq'::regclass);
3163
3164
3165--
3166-- Name: accreq_attributes_list acccreq_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3167--
3168
3169ALTER TABLE ONLY public.accreq_attributes_list
3170    ADD CONSTRAINT acccreq_attributes_list_pkey PRIMARY KEY (canonical);
3171
3172
3173--
3174-- Name: accreq_attributes accreq_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3175--
3176
3177ALTER TABLE ONLY public.accreq_attributes
3178    ADD CONSTRAINT accreq_attributes_pkey PRIMARY KEY (attr_key);
3179
3180
3181--
3182-- Name: accreq accreq_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3183--
3184
3185ALTER TABLE ONLY public.accreq
3186    ADD CONSTRAINT accreq_ikey_uniq UNIQUE (ikey);
3187
3188
3189--
3190-- Name: accreq accreq_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3191--
3192
3193ALTER TABLE ONLY public.accreq
3194    ADD CONSTRAINT accreq_pkey PRIMARY KEY (name);
3195
3196
3197--
3198-- Name: address_attributes_base address_attr_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3199--
3200
3201ALTER TABLE ONLY public.address_attributes_base
3202    ADD CONSTRAINT address_attr_pkey PRIMARY KEY (attr_key);
3203
3204
3205--
3206-- Name: address_attributes_site address_attr_site_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3207--
3208
3209ALTER TABLE ONLY public.address_attributes_site
3210    ADD CONSTRAINT address_attr_site_pkey PRIMARY KEY (attr_key);
3211
3212
3213--
3214-- Name: address_attributes_list address_attributes_list_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3215--
3216
3217ALTER TABLE ONLY public.address_attributes_list
3218    ADD CONSTRAINT address_attributes_list_c_uniq UNIQUE (canonical);
3219
3220
3221--
3222-- Name: address_attributes_list address_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3223--
3224
3225ALTER TABLE ONLY public.address_attributes_list
3226    ADD CONSTRAINT address_attributes_list_pkey PRIMARY KEY (ikey);
3227
3228
3229--
3230-- Name: address_attributes_list_site address_attributes_list_site_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3231--
3232
3233ALTER TABLE ONLY public.address_attributes_list_site
3234    ADD CONSTRAINT address_attributes_list_site_c_uniq UNIQUE (canonical);
3235
3236
3237--
3238-- Name: address_attributes_list_site address_attributes_list_site_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3239--
3240
3241ALTER TABLE ONLY public.address_attributes_list_site
3242    ADD CONSTRAINT address_attributes_list_site_pkey PRIMARY KEY (ikey);
3243
3244
3245--
3246-- Name: address address_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3247--
3248
3249ALTER TABLE ONLY public.address
3250    ADD CONSTRAINT address_ikey_uniq UNIQUE (ikey);
3251
3252
3253--
3254-- Name: address address_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3255--
3256
3257ALTER TABLE ONLY public.address
3258    ADD CONSTRAINT address_pkey PRIMARY KEY (name);
3259
3260
3261--
3262-- Name: aliases_attributes_base aliases_attributes_base_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3263--
3264
3265ALTER TABLE ONLY public.aliases_attributes_base
3266    ADD CONSTRAINT aliases_attributes_base_pkey PRIMARY KEY (attr_key);
3267
3268
3269--
3270-- Name: aliases_attributes_list aliases_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3271--
3272
3273ALTER TABLE ONLY public.aliases_attributes_list
3274    ADD CONSTRAINT aliases_attributes_list_pkey PRIMARY KEY (ikey);
3275
3276
3277--
3278-- Name: aliases aliases_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3279--
3280
3281ALTER TABLE ONLY public.aliases
3282    ADD CONSTRAINT aliases_ikey_uniq UNIQUE (ikey);
3283
3284
3285--
3286-- Name: aliases aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3287--
3288
3289ALTER TABLE ONLY public.aliases
3290    ADD CONSTRAINT aliases_pkey PRIMARY KEY (name);
3291
3292
3293--
3294-- Name: attributes_list attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3295--
3296
3297ALTER TABLE ONLY public.attributes_list
3298    ADD CONSTRAINT attributes_list_pkey PRIMARY KEY (ikey);
3299
3300
3301--
3302-- Name: attributes attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3303--
3304
3305ALTER TABLE ONLY public.attributes
3306    ADD CONSTRAINT attributes_pkey PRIMARY KEY (attr_key);
3307
3308
3309--
3310-- Name: attributes_values attributes_values_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3311--
3312
3313ALTER TABLE ONLY public.attributes_values
3314    ADD CONSTRAINT attributes_values_pkey PRIMARY KEY (ikey);
3315
3316
3317--
3318-- Name: employment_attributes_list employment_attr_l_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3319--
3320
3321ALTER TABLE ONLY public.employment_attributes_list
3322    ADD CONSTRAINT employment_attr_l_c_uniq UNIQUE (canonical);
3323
3324
3325--
3326-- Name: employment_attributes_list employment_attr_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3327--
3328
3329ALTER TABLE ONLY public.employment_attributes_list
3330    ADD CONSTRAINT employment_attr_list_pkey PRIMARY KEY (ikey);
3331
3332
3333--
3334-- Name: employment_attributes employment_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3335--
3336
3337ALTER TABLE ONLY public.employment_attributes
3338    ADD CONSTRAINT employment_attributes_pkey PRIMARY KEY (attr_key);
3339
3340
3341--
3342-- Name: employment employment_okey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3343--
3344
3345ALTER TABLE ONLY public.employment
3346    ADD CONSTRAINT employment_okey_uniq UNIQUE (ikey);
3347
3348
3349--
3350-- Name: employment employment_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3351--
3352
3353ALTER TABLE ONLY public.employment
3354    ADD CONSTRAINT employment_pkey PRIMARY KEY (name);
3355
3356
3357--
3358-- Name: aliases_attributes_list g_attr_l_aliases_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3359--
3360
3361ALTER TABLE ONLY public.aliases_attributes_list
3362    ADD CONSTRAINT g_attr_l_aliases_uniq UNIQUE (canonical);
3363
3364
3365--
3366-- Name: group_attributes_list g_attr_l_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3367--
3368
3369ALTER TABLE ONLY public.group_attributes_list
3370    ADD CONSTRAINT g_attr_l_c_uniq UNIQUE (canonical);
3371
3372
3373--
3374-- Name: nethost_attributes_list g_attr_l_nethost_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3375--
3376
3377ALTER TABLE ONLY public.nethost_attributes_list
3378    ADD CONSTRAINT g_attr_l_nethost_uniq UNIQUE (canonical);
3379
3380
3381--
3382-- Name: netzone_attributes_list g_attr_l_netzone_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3383--
3384
3385ALTER TABLE ONLY public.netzone_attributes_list
3386    ADD CONSTRAINT g_attr_l_netzone_uniq UNIQUE (canonical);
3387
3388
3389--
3390-- Name: service_attributes_list g_attr_l_service_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3391--
3392
3393ALTER TABLE ONLY public.service_attributes_list
3394    ADD CONSTRAINT g_attr_l_service_uniq UNIQUE (canonical);
3395
3396
3397--
3398-- Name: group_attributes_list g_attr_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3399--
3400
3401ALTER TABLE ONLY public.group_attributes_list
3402    ADD CONSTRAINT g_attr_list_pkey PRIMARY KEY (ikey);
3403
3404
3405--
3406-- Name: group goup_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3407--
3408
3409ALTER TABLE ONLY public."group"
3410    ADD CONSTRAINT goup_pkey PRIMARY KEY (name);
3411
3412
3413--
3414-- Name: group_attributes_base group_attrbutes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3415--
3416
3417ALTER TABLE ONLY public.group_attributes_base
3418    ADD CONSTRAINT group_attrbutes_pkey PRIMARY KEY (attr_key);
3419
3420
3421--
3422-- Name: group_attributes_sutypes group_attributes_sutypes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3423--
3424
3425ALTER TABLE ONLY public.group_attributes_sutypes
3426    ADD CONSTRAINT group_attributes_sutypes_pkey PRIMARY KEY (attr_key);
3427
3428
3429--
3430-- Name: group_attributes_users group_attributes_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3431--
3432
3433ALTER TABLE ONLY public.group_attributes_users
3434    ADD CONSTRAINT group_attributes_user_pkey PRIMARY KEY (attr_key);
3435
3436
3437--
3438-- Name: group_attributes_users group_attributes_users_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3439--
3440
3441ALTER TABLE ONLY public.group_attributes_users
3442    ADD CONSTRAINT group_attributes_users_uniq UNIQUE (okey, attr, value);
3443
3444
3445--
3446-- Name: group group_gid_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3447--
3448
3449ALTER TABLE ONLY public."group"
3450    ADD CONSTRAINT group_gid_uniq UNIQUE (gidnumber);
3451
3452
3453--
3454-- Name: group group_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3455--
3456
3457ALTER TABLE ONLY public."group"
3458    ADD CONSTRAINT group_ikey_uniq UNIQUE (ikey);
3459
3460
3461--
3462-- Name: nethost_attributes_ips nethost_attributes_ip_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3463--
3464
3465ALTER TABLE ONLY public.nethost_attributes_ips
3466    ADD CONSTRAINT nethost_attributes_ip_pkey PRIMARY KEY (attr_key);
3467
3468
3469--
3470-- Name: nethost_attributes_list nethost_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3471--
3472
3473ALTER TABLE ONLY public.nethost_attributes_list
3474    ADD CONSTRAINT nethost_attributes_list_pkey PRIMARY KEY (ikey);
3475
3476
3477--
3478-- Name: nethost_attributes_macs nethost_attributes_mac_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3479--
3480
3481ALTER TABLE ONLY public.nethost_attributes_macs
3482    ADD CONSTRAINT nethost_attributes_mac_pkey PRIMARY KEY (attr_key);
3483
3484
3485--
3486-- Name: nethost_attributes_nethosts nethost_attributes_nethosts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3487--
3488
3489ALTER TABLE ONLY public.nethost_attributes_nethosts
3490    ADD CONSTRAINT nethost_attributes_nethosts_pkey PRIMARY KEY (attr_key);
3491
3492
3493--
3494-- Name: nethost_attributes nethost_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3495--
3496
3497ALTER TABLE ONLY public.nethost_attributes
3498    ADD CONSTRAINT nethost_attributes_pkey PRIMARY KEY (attr_key);
3499
3500
3501--
3502-- Name: nethost_attributes_users nethost_attributes_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3503--
3504
3505ALTER TABLE ONLY public.nethost_attributes_users
3506    ADD CONSTRAINT nethost_attributes_user_pkey PRIMARY KEY (attr_key);
3507
3508
3509--
3510-- Name: nethost_attributes_users nethost_attributes_users_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3511--
3512
3513ALTER TABLE ONLY public.nethost_attributes_users
3514    ADD CONSTRAINT nethost_attributes_users_uniq UNIQUE (okey, attr, value);
3515
3516
3517--
3518-- Name: nethost nethost_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3519--
3520
3521ALTER TABLE ONLY public.nethost
3522    ADD CONSTRAINT nethost_ikey_uniq UNIQUE (ikey);
3523
3524
3525--
3526-- Name: nethost nethost_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3527--
3528
3529ALTER TABLE ONLY public.nethost
3530    ADD CONSTRAINT nethost_pkey PRIMARY KEY (name);
3531
3532
3533--
3534-- Name: netzone_attributes_netzone netzone_attr_netzone_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3535--
3536
3537ALTER TABLE ONLY public.netzone_attributes_netzone
3538    ADD CONSTRAINT netzone_attr_netzone_pkey PRIMARY KEY (attr_key);
3539
3540
3541--
3542-- Name: netzone_attributes_site netzone_attr_site_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3543--
3544
3545ALTER TABLE ONLY public.netzone_attributes_site
3546    ADD CONSTRAINT netzone_attr_site_pkey PRIMARY KEY (attr_key);
3547
3548
3549--
3550-- Name: netzone_attributes_list netzone_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3551--
3552
3553ALTER TABLE ONLY public.netzone_attributes_list
3554    ADD CONSTRAINT netzone_attributes_list_pkey PRIMARY KEY (ikey);
3555
3556
3557--
3558-- Name: netzone_attributes netzone_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3559--
3560
3561ALTER TABLE ONLY public.netzone_attributes
3562    ADD CONSTRAINT netzone_attributes_pkey PRIMARY KEY (attr_key);
3563
3564
3565--
3566-- Name: netzone netzone_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3567--
3568
3569ALTER TABLE ONLY public.netzone
3570    ADD CONSTRAINT netzone_ikey_uniq UNIQUE (ikey);
3571
3572
3573--
3574-- Name: netzone netzone_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3575--
3576
3577ALTER TABLE ONLY public.netzone
3578    ADD CONSTRAINT netzone_pkey PRIMARY KEY (name);
3579
3580
3581--
3582-- Name: objectslogs objectlogs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3583--
3584
3585ALTER TABLE ONLY public.objectslogs
3586    ADD CONSTRAINT objectlogs_pkey PRIMARY KEY (logkey);
3587
3588
3589--
3590-- Name: objects objects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3591--
3592
3593ALTER TABLE ONLY public.objects
3594    ADD CONSTRAINT objects_pkey PRIMARY KEY (ikey);
3595
3596
3597--
3598-- Name: user_attributes_list p_attr_l_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3599--
3600
3601ALTER TABLE ONLY public.user_attributes_list
3602    ADD CONSTRAINT p_attr_l_c_uniq UNIQUE (canonical);
3603
3604
3605--
3606-- Name: user_attributes_list p_attr_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3607--
3608
3609ALTER TABLE ONLY public.user_attributes_list
3610    ADD CONSTRAINT p_attr_list_pkey PRIMARY KEY (ikey);
3611
3612
3613--
3614-- Name: passwordreset passwordreset_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3615--
3616
3617ALTER TABLE ONLY public.passwordreset
3618    ADD CONSTRAINT passwordreset_pkey PRIMARY KEY (id);
3619
3620
3621--
3622-- Name: user person_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3623--
3624
3625ALTER TABLE ONLY public."user"
3626    ADD CONSTRAINT person_pkey PRIMARY KEY (name);
3627
3628
3629--
3630-- Name: user person_uid_key; Type: CONSTRAINT; Schema: public; Owner: -
3631--
3632
3633ALTER TABLE ONLY public."user"
3634    ADD CONSTRAINT person_uid_key UNIQUE (uidnumber);
3635
3636
3637--
3638-- Name: request request_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3639--
3640
3641ALTER TABLE ONLY public.request
3642    ADD CONSTRAINT request_pkey PRIMARY KEY (id);
3643
3644
3645--
3646-- Name: revaliases revaliases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3647--
3648
3649ALTER TABLE ONLY public.revaliases
3650    ADD CONSTRAINT revaliases_pkey PRIMARY KEY (name);
3651
3652
3653--
3654-- Name: revisions revisions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3655--
3656
3657ALTER TABLE ONLY public.revisions
3658    ADD CONSTRAINT revisions_pkey PRIMARY KEY (ikey);
3659
3660
3661--
3662-- Name: site_attributes_list s_attr_l_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3663--
3664
3665ALTER TABLE ONLY public.site_attributes_list
3666    ADD CONSTRAINT s_attr_l_c_uniq UNIQUE (canonical);
3667
3668
3669--
3670-- Name: site_attributes_list s_attr_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3671--
3672
3673ALTER TABLE ONLY public.site_attributes_list
3674    ADD CONSTRAINT s_attr_list_pkey PRIMARY KEY (ikey);
3675
3676
3677--
3678-- Name: service_attributes_list service_attributes_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3679--
3680
3681ALTER TABLE ONLY public.service_attributes_list
3682    ADD CONSTRAINT service_attributes_list_pkey PRIMARY KEY (ikey);
3683
3684
3685--
3686-- Name: service_attributes service_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3687--
3688
3689ALTER TABLE ONLY public.service_attributes
3690    ADD CONSTRAINT service_attributes_pkey PRIMARY KEY (attr_key);
3691
3692
3693--
3694-- Name: service_attributes_users service_attributes_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3695--
3696
3697ALTER TABLE ONLY public.service_attributes_users
3698    ADD CONSTRAINT service_attributes_user_pkey PRIMARY KEY (attr_key);
3699
3700
3701--
3702-- Name: service_attributes_users service_attributes_users_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3703--
3704
3705ALTER TABLE ONLY public.service_attributes_users
3706    ADD CONSTRAINT service_attributes_users_uniq UNIQUE (okey, attr, value);
3707
3708
3709--
3710-- Name: service service_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3711--
3712
3713ALTER TABLE ONLY public.service
3714    ADD CONSTRAINT service_ikey_uniq UNIQUE (ikey);
3715
3716
3717--
3718-- Name: service service_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3719--
3720
3721ALTER TABLE ONLY public.service
3722    ADD CONSTRAINT service_pkey PRIMARY KEY (name);
3723
3724
3725--
3726-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3727--
3728
3729ALTER TABLE ONLY public.settings
3730    ADD CONSTRAINT settings_pkey PRIMARY KEY (varname);
3731
3732
3733--
3734-- Name: site_attributes site_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3735--
3736
3737ALTER TABLE ONLY public.site_attributes
3738    ADD CONSTRAINT site_attributes_pkey PRIMARY KEY (attr_key);
3739
3740
3741--
3742-- Name: site site_okey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3743--
3744
3745ALTER TABLE ONLY public.site
3746    ADD CONSTRAINT site_okey_uniq UNIQUE (ikey);
3747
3748
3749--
3750-- Name: site site_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3751--
3752
3753ALTER TABLE ONLY public.site
3754    ADD CONSTRAINT site_pkey PRIMARY KEY (name);
3755
3756
3757--
3758-- Name: stat_attributes_list stat_attr_l_c_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3759--
3760
3761ALTER TABLE ONLY public.stat_attributes_list
3762    ADD CONSTRAINT stat_attr_l_c_uniq UNIQUE (canonical);
3763
3764
3765--
3766-- Name: stat_attributes_list stat_attr_list_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3767--
3768
3769ALTER TABLE ONLY public.stat_attributes_list
3770    ADD CONSTRAINT stat_attr_list_pkey PRIMARY KEY (ikey);
3771
3772
3773--
3774-- Name: stat_attributes stat_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3775--
3776
3777ALTER TABLE ONLY public.stat_attributes
3778    ADD CONSTRAINT stat_attributes_pkey PRIMARY KEY (attr_key);
3779
3780
3781--
3782-- Name: stat stat_okey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3783--
3784
3785ALTER TABLE ONLY public.stat
3786    ADD CONSTRAINT stat_okey_uniq UNIQUE (ikey);
3787
3788
3789--
3790-- Name: stat stat_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3791--
3792
3793ALTER TABLE ONLY public.stat
3794    ADD CONSTRAINT stat_pkey PRIMARY KEY (name);
3795
3796
3797--
3798-- Name: statsentry statsentry_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3799--
3800
3801ALTER TABLE ONLY public.statsentry
3802    ADD CONSTRAINT statsentry_pkey PRIMARY KEY (id);
3803
3804
3805--
3806-- Name: statvalues statvalues_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3807--
3808
3809ALTER TABLE ONLY public.statvalues
3810    ADD CONSTRAINT statvalues_pkey PRIMARY KEY (sid, value);
3811
3812
3813--
3814-- Name: su_type su_type_name_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3815--
3816
3817ALTER TABLE ONLY public.su_type
3818    ADD CONSTRAINT su_type_name_uniq UNIQUE (name);
3819
3820
3821--
3822-- Name: su_type su_type_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3823--
3824
3825ALTER TABLE ONLY public.su_type
3826    ADD CONSTRAINT su_type_pkey PRIMARY KEY (ikey);
3827
3828
3829--
3830-- Name: user_attributes_groups user_attr_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3831--
3832
3833ALTER TABLE ONLY public.user_attributes_groups
3834    ADD CONSTRAINT user_attr_groups_pkey PRIMARY KEY (attr_key);
3835
3836
3837--
3838-- Name: user_attributes_site user_attr_site_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3839--
3840
3841ALTER TABLE ONLY public.user_attributes_site
3842    ADD CONSTRAINT user_attr_site_pkey PRIMARY KEY (attr_key);
3843
3844
3845--
3846-- Name: user_attributes_users user_attr_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3847--
3848
3849ALTER TABLE ONLY public.user_attributes_users
3850    ADD CONSTRAINT user_attr_user_pkey PRIMARY KEY (attr_key);
3851
3852
3853--
3854-- Name: user_attributes_base user_attributes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
3855--
3856
3857ALTER TABLE ONLY public.user_attributes_base
3858    ADD CONSTRAINT user_attributes_pkey PRIMARY KEY (attr_key);
3859
3860
3861--
3862-- Name: user user_ikey_uniq; Type: CONSTRAINT; Schema: public; Owner: -
3863--
3864
3865ALTER TABLE ONLY public."user"
3866    ADD CONSTRAINT user_ikey_uniq UNIQUE (ikey);
3867
3868
3869--
3870-- Name: address_attr_base_attr_idx; Type: INDEX; Schema: public; Owner: -
3871--
3872
3873CREATE INDEX address_attr_base_attr_idx ON public.address_attributes_base USING btree (attr);
3874
3875
3876--
3877-- Name: address_exported_idx; Type: INDEX; Schema: public; Owner: -
3878--
3879
3880CREATE INDEX address_exported_idx ON public.address USING btree (exported);
3881
3882
3883--
3884-- Name: aliases_attr_value_idx; Type: INDEX; Schema: public; Owner: -
3885--
3886
3887CREATE INDEX aliases_attr_value_idx ON public.aliases_attributes_base USING btree (value);
3888
3889
3890--
3891-- Name: aliases_attributes_base_attr_fkey; Type: INDEX; Schema: public; Owner: -
3892--
3893
3894CREATE INDEX aliases_attributes_base_attr_fkey ON public.aliases_attributes_base USING btree (attr);
3895
3896
3897--
3898-- Name: aliases_exported_idx; Type: INDEX; Schema: public; Owner: -
3899--
3900
3901CREATE INDEX aliases_exported_idx ON public.aliases USING btree (exported);
3902
3903
3904--
3905-- Name: aliases_forwards_idx; Type: INDEX; Schema: public; Owner: -
3906--
3907
3908CREATE INDEX aliases_forwards_idx ON public.aliases USING gin (forward);
3909
3910
3911--
3912-- Name: aliases_name_lower_idx; Type: INDEX; Schema: public; Owner: -
3913--
3914
3915CREATE UNIQUE INDEX aliases_name_lower_idx ON public.aliases USING btree (lower(name));
3916
3917
3918--
3919-- Name: aliases_rev_idx; Type: INDEX; Schema: public; Owner: -
3920--
3921
3922CREATE INDEX aliases_rev_idx ON public.aliases USING btree (rev);
3923
3924
3925--
3926-- Name: attributes_values_idx; Type: INDEX; Schema: public; Owner: -
3927--
3928
3929CREATE UNIQUE INDEX attributes_values_idx ON public.attributes_values USING btree (otype, attributes, value);
3930
3931
3932--
3933-- Name: employment_attr_value_idx; Type: INDEX; Schema: public; Owner: -
3934--
3935
3936CREATE INDEX employment_attr_value_idx ON public.employment_attributes USING btree (value);
3937
3938
3939--
3940-- Name: employment_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
3941--
3942
3943CREATE INDEX employment_attributes_attr_fkey ON public.employment_attributes USING btree (attr);
3944
3945
3946--
3947-- Name: employment_exported_idx; Type: INDEX; Schema: public; Owner: -
3948--
3949
3950CREATE INDEX employment_exported_idx ON public.employment USING btree (exported);
3951
3952
3953--
3954-- Name: employment_firstday_idx; Type: INDEX; Schema: public; Owner: -
3955--
3956
3957CREATE INDEX employment_firstday_idx ON public.employment USING btree (firstday NULLS FIRST);
3958
3959
3960--
3961-- Name: employment_lastday_idx; Type: INDEX; Schema: public; Owner: -
3962--
3963
3964CREATE INDEX employment_lastday_idx ON public.employment USING btree (lastday);
3965
3966
3967--
3968-- Name: employment_rev_idx; Type: INDEX; Schema: public; Owner: -
3969--
3970
3971CREATE UNIQUE INDEX employment_rev_idx ON public.employment USING btree (rev);
3972
3973
3974--
3975-- Name: fki_accreq_attr_okey_fkey; Type: INDEX; Schema: public; Owner: -
3976--
3977
3978CREATE INDEX fki_accreq_attr_okey_fkey ON public.accreq_attributes USING btree (okey);
3979
3980
3981--
3982-- Name: fki_accreq_attributes_list_attr_fkey; Type: INDEX; Schema: public; Owner: -
3983--
3984
3985CREATE INDEX fki_accreq_attributes_list_attr_fkey ON public.accreq_attributes USING btree (attr);
3986
3987
3988--
3989-- Name: fki_address_attr_site_okey_fkey; Type: INDEX; Schema: public; Owner: -
3990--
3991
3992CREATE INDEX fki_address_attr_site_okey_fkey ON public.address_attributes_site USING btree (okey);
3993
3994
3995--
3996-- Name: fki_address_attributes_okey_fkey; Type: INDEX; Schema: public; Owner: -
3997--
3998
3999CREATE INDEX fki_address_attributes_okey_fkey ON public.address_attributes_base USING btree (okey);
4000
4001
4002--
4003-- Name: fki_address_attributes_site_attr_fkey; Type: INDEX; Schema: public; Owner: -
4004--
4005
4006CREATE INDEX fki_address_attributes_site_attr_fkey ON public.address_attributes_site USING btree (attr);
4007
4008
4009--
4010-- Name: fki_address_attributes_site_value_fkey; Type: INDEX; Schema: public; Owner: -
4011--
4012
4013CREATE INDEX fki_address_attributes_site_value_fkey ON public.address_attributes_site USING btree (value);
4014
4015
4016--
4017-- Name: fki_address_user_fkey; Type: INDEX; Schema: public; Owner: -
4018--
4019
4020CREATE INDEX fki_address_user_fkey ON public.address USING btree ("user");
4021
4022
4023--
4024-- Name: fki_employment; Type: INDEX; Schema: public; Owner: -
4025--
4026
4027CREATE INDEX fki_employment ON public.employment_attributes USING btree (okey);
4028
4029
4030--
4031-- Name: fki_group_attr_okey_fkey; Type: INDEX; Schema: public; Owner: -
4032--
4033
4034CREATE INDEX fki_group_attr_okey_fkey ON public.group_attributes_base USING btree (okey);
4035
4036
4037--
4038-- Name: fki_group_attr_sutypes_okey_fkey; Type: INDEX; Schema: public; Owner: -
4039--
4040
4041CREATE INDEX fki_group_attr_sutypes_okey_fkey ON public.group_attributes_sutypes USING btree (okey);
4042
4043
4044--
4045-- Name: fki_group_attr_users_okey_fkey; Type: INDEX; Schema: public; Owner: -
4046--
4047
4048CREATE INDEX fki_group_attr_users_okey_fkey ON public.group_attributes_users USING btree (okey);
4049
4050
4051--
4052-- Name: fki_group_attributes_sutypes_attr; Type: INDEX; Schema: public; Owner: -
4053--
4054
4055CREATE INDEX fki_group_attributes_sutypes_attr ON public.group_attributes_sutypes USING btree (attr);
4056
4057
4058--
4059-- Name: fki_group_attributes_sutypes_sutype_fkey; Type: INDEX; Schema: public; Owner: -
4060--
4061
4062CREATE INDEX fki_group_attributes_sutypes_sutype_fkey ON public.group_attributes_sutypes USING btree (value);
4063
4064
4065--
4066-- Name: fki_group_attributes_users_attr_fkey; Type: INDEX; Schema: public; Owner: -
4067--
4068
4069CREATE INDEX fki_group_attributes_users_attr_fkey ON public.group_attributes_users USING btree (attr);
4070
4071
4072--
4073-- Name: fki_group_attributes_users_user_fkey; Type: INDEX; Schema: public; Owner: -
4074--
4075
4076CREATE INDEX fki_group_attributes_users_user_fkey ON public.group_attributes_users USING btree (value);
4077
4078
4079--
4080-- Name: fki_nethost_attr_ip_fkey; Type: INDEX; Schema: public; Owner: -
4081--
4082
4083CREATE INDEX fki_nethost_attr_ip_fkey ON public.nethost_attributes_ips USING btree (okey);
4084
4085
4086--
4087-- Name: fki_nethost_attr_mac_fkey; Type: INDEX; Schema: public; Owner: -
4088--
4089
4090CREATE INDEX fki_nethost_attr_mac_fkey ON public.nethost_attributes_macs USING btree (okey);
4091
4092
4093--
4094-- Name: fki_nethost_attr_nethosts_fkey; Type: INDEX; Schema: public; Owner: -
4095--
4096
4097CREATE INDEX fki_nethost_attr_nethosts_fkey ON public.nethost_attributes_nethosts USING btree (okey);
4098
4099
4100--
4101-- Name: fki_nethost_attr_users_okey_fkey; Type: INDEX; Schema: public; Owner: -
4102--
4103
4104CREATE INDEX fki_nethost_attr_users_okey_fkey ON public.nethost_attributes_users USING btree (okey);
4105
4106
4107--
4108-- Name: fki_nethost_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4109--
4110
4111CREATE INDEX fki_nethost_attributes_attr_fkey ON public.nethost_attributes USING btree (attr);
4112
4113
4114--
4115-- Name: fki_nethost_attributes_users_attr_fkey; Type: INDEX; Schema: public; Owner: -
4116--
4117
4118CREATE INDEX fki_nethost_attributes_users_attr_fkey ON public.nethost_attributes_users USING btree (attr);
4119
4120
4121--
4122-- Name: fki_nethost_attributes_users_user_fkey; Type: INDEX; Schema: public; Owner: -
4123--
4124
4125CREATE INDEX fki_nethost_attributes_users_user_fkey ON public.nethost_attributes_users USING btree (value);
4126
4127
4128--
4129-- Name: fki_netzone_attr_netzone_okey_fkey; Type: INDEX; Schema: public; Owner: -
4130--
4131
4132CREATE INDEX fki_netzone_attr_netzone_okey_fkey ON public.netzone_attributes_netzone USING btree (okey);
4133
4134
4135--
4136-- Name: fki_netzone_attr_site_okey_fkey; Type: INDEX; Schema: public; Owner: -
4137--
4138
4139CREATE INDEX fki_netzone_attr_site_okey_fkey ON public.netzone_attributes_site USING btree (okey);
4140
4141
4142--
4143-- Name: fki_netzone_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4144--
4145
4146CREATE INDEX fki_netzone_attributes_attr_fkey ON public.netzone_attributes USING btree (attr);
4147
4148
4149--
4150-- Name: fki_netzone_attributes_netzone_attr_fkey; Type: INDEX; Schema: public; Owner: -
4151--
4152
4153CREATE INDEX fki_netzone_attributes_netzone_attr_fkey ON public.netzone_attributes_netzone USING btree (attr);
4154
4155
4156--
4157-- Name: fki_netzone_attributes_netzone_value_fkey; Type: INDEX; Schema: public; Owner: -
4158--
4159
4160CREATE INDEX fki_netzone_attributes_netzone_value_fkey ON public.netzone_attributes_netzone USING btree (value);
4161
4162
4163--
4164-- Name: fki_netzone_attributes_site_attr_fkey; Type: INDEX; Schema: public; Owner: -
4165--
4166
4167CREATE INDEX fki_netzone_attributes_site_attr_fkey ON public.netzone_attributes_site USING btree (attr);
4168
4169
4170--
4171-- Name: fki_netzone_attributes_site_value_fkey; Type: INDEX; Schema: public; Owner: -
4172--
4173
4174CREATE INDEX fki_netzone_attributes_site_value_fkey ON public.netzone_attributes_site USING btree (value);
4175
4176
4177--
4178-- Name: fki_request_id_fkey; Type: INDEX; Schema: public; Owner: -
4179--
4180
4181CREATE INDEX fki_request_id_fkey ON public.request_attributes USING btree (reqid);
4182
4183
4184--
4185-- Name: fki_request_name_fkey; Type: INDEX; Schema: public; Owner: -
4186--
4187
4188CREATE INDEX fki_request_name_fkey ON public.request USING btree (name);
4189
4190
4191--
4192-- Name: fki_request_user_fkey; Type: INDEX; Schema: public; Owner: -
4193--
4194
4195CREATE INDEX fki_request_user_fkey ON public.request USING btree ("user");
4196
4197
4198--
4199-- Name: fki_revaliase_name_user_fkey; Type: INDEX; Schema: public; Owner: -
4200--
4201
4202CREATE INDEX fki_revaliase_name_user_fkey ON public.revaliases USING btree (name);
4203
4204
4205--
4206-- Name: fki_revaliases_user_fkey; Type: INDEX; Schema: public; Owner: -
4207--
4208
4209CREATE INDEX fki_revaliases_user_fkey ON public.revaliases USING btree (name);
4210
4211
4212--
4213-- Name: fki_service_attr_users_okey_fkey; Type: INDEX; Schema: public; Owner: -
4214--
4215
4216CREATE INDEX fki_service_attr_users_okey_fkey ON public.service_attributes_users USING btree (okey);
4217
4218
4219--
4220-- Name: fki_service_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4221--
4222
4223CREATE INDEX fki_service_attributes_attr_fkey ON public.nethost_attributes USING btree (attr);
4224
4225
4226--
4227-- Name: fki_service_attributes_users_attr_fkey; Type: INDEX; Schema: public; Owner: -
4228--
4229
4230CREATE INDEX fki_service_attributes_users_attr_fkey ON public.service_attributes_users USING btree (attr);
4231
4232
4233--
4234-- Name: fki_service_attributes_users_user_fkey; Type: INDEX; Schema: public; Owner: -
4235--
4236
4237CREATE INDEX fki_service_attributes_users_user_fkey ON public.service_attributes_users USING btree (value);
4238
4239
4240--
4241-- Name: fki_site_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4242--
4243
4244CREATE INDEX fki_site_attributes_attr_fkey ON public.site_attributes USING btree (attr);
4245
4246
4247--
4248-- Name: fki_user_attr_groups_okey_fkey; Type: INDEX; Schema: public; Owner: -
4249--
4250
4251CREATE INDEX fki_user_attr_groups_okey_fkey ON public.user_attributes_groups USING btree (okey);
4252
4253
4254--
4255-- Name: fki_user_attr_okey_fkey; Type: INDEX; Schema: public; Owner: -
4256--
4257
4258CREATE INDEX fki_user_attr_okey_fkey ON public.user_attributes_base USING btree (okey);
4259
4260
4261--
4262-- Name: fki_user_attr_site_okey_fkey; Type: INDEX; Schema: public; Owner: -
4263--
4264
4265CREATE INDEX fki_user_attr_site_okey_fkey ON public.user_attributes_site USING btree (okey);
4266
4267
4268--
4269-- Name: fki_user_attr_users_okey_fkey; Type: INDEX; Schema: public; Owner: -
4270--
4271
4272CREATE INDEX fki_user_attr_users_okey_fkey ON public.user_attributes_users USING btree (okey);
4273
4274
4275--
4276-- Name: fki_user_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4277--
4278
4279CREATE INDEX fki_user_attributes_attr_fkey ON public.user_attributes_base USING btree (attr);
4280
4281
4282--
4283-- Name: fki_user_attributes_groups_attr_fkey; Type: INDEX; Schema: public; Owner: -
4284--
4285
4286CREATE INDEX fki_user_attributes_groups_attr_fkey ON public.user_attributes_groups USING btree (attr);
4287
4288
4289--
4290-- Name: fki_user_attributes_groups_value_fkey; Type: INDEX; Schema: public; Owner: -
4291--
4292
4293CREATE INDEX fki_user_attributes_groups_value_fkey ON public.user_attributes_groups USING btree (value);
4294
4295
4296--
4297-- Name: fki_user_attributes_site_attr_fkey; Type: INDEX; Schema: public; Owner: -
4298--
4299
4300CREATE INDEX fki_user_attributes_site_attr_fkey ON public.user_attributes_site USING btree (attr);
4301
4302
4303--
4304-- Name: fki_user_attributes_site_value_fkey; Type: INDEX; Schema: public; Owner: -
4305--
4306
4307CREATE INDEX fki_user_attributes_site_value_fkey ON public.user_attributes_site USING btree (value);
4308
4309
4310--
4311-- Name: fki_user_attributes_users_attr_fkey; Type: INDEX; Schema: public; Owner: -
4312--
4313
4314CREATE INDEX fki_user_attributes_users_attr_fkey ON public.user_attributes_users USING btree (attr);
4315
4316
4317--
4318-- Name: fki_user_attributes_users_value_fkey; Type: INDEX; Schema: public; Owner: -
4319--
4320
4321CREATE INDEX fki_user_attributes_users_value_fkey ON public.user_attributes_users USING btree (value);
4322
4323
4324--
4325-- Name: group_attributes_base_value_idx; Type: INDEX; Schema: public; Owner: -
4326--
4327
4328CREATE INDEX group_attributes_base_value_idx ON public.group_attributes_base USING btree (value);
4329
4330
4331--
4332-- Name: group_exported_idx; Type: INDEX; Schema: public; Owner: -
4333--
4334
4335CREATE INDEX group_exported_idx ON public."group" USING btree (exported);
4336
4337
4338--
4339-- Name: group_rev_idx; Type: INDEX; Schema: public; Owner: -
4340--
4341
4342CREATE INDEX group_rev_idx ON public."group" USING btree (rev);
4343
4344
4345--
4346-- Name: nethost_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4347--
4348
4349CREATE INDEX nethost_attr_value_idx ON public.nethost_attributes USING btree (value);
4350
4351
4352--
4353-- Name: nethost_attributes_ip_idx; Type: INDEX; Schema: public; Owner: -
4354--
4355
4356CREATE UNIQUE INDEX nethost_attributes_ip_idx ON public.nethost_attributes_ips USING btree (((value)::inet));
4357
4358
4359--
4360-- Name: nethost_attributes_mac_idx; Type: INDEX; Schema: public; Owner: -
4361--
4362
4363CREATE UNIQUE INDEX nethost_attributes_mac_idx ON public.nethost_attributes_macs USING btree (((value)::macaddr));
4364
4365
4366--
4367-- Name: nethost_cname_uniq_idx; Type: INDEX; Schema: public; Owner: -
4368--
4369
4370CREATE UNIQUE INDEX nethost_cname_uniq_idx ON public.nethost_attributes USING btree (value, okey) WHERE (attr = 'cname'::text);
4371
4372
4373--
4374-- Name: netzone_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4375--
4376
4377CREATE INDEX netzone_attr_value_idx ON public.netzone_attributes USING btree (value);
4378
4379
4380--
4381-- Name: netzone_attributes_net_idx; Type: INDEX; Schema: public; Owner: -
4382--
4383
4384CREATE UNIQUE INDEX netzone_attributes_net_idx ON public.netzone_attributes USING btree (((value)::inet), attr, okey) WHERE (attr = 'net'::text);
4385
4386
4387--
4388-- Name: netzone_attributes_netexclude_idx; Type: INDEX; Schema: public; Owner: -
4389--
4390
4391CREATE UNIQUE INDEX netzone_attributes_netexclude_idx ON public.netzone_attributes USING btree (((value)::inet), attr, okey) WHERE (attr = 'netExclude'::text);
4392
4393
4394--
4395-- Name: objectlogs_name_idx; Type: INDEX; Schema: public; Owner: -
4396--
4397
4398CREATE INDEX objectlogs_name_idx ON public.objectslogs USING btree (name);
4399
4400
4401--
4402-- Name: objectslogs_ikey_idx; Type: INDEX; Schema: public; Owner: -
4403--
4404
4405CREATE INDEX objectslogs_ikey_idx ON public.objectslogs USING btree (ikey);
4406
4407
4408--
4409-- Name: objectslogs_otype_idx; Type: INDEX; Schema: public; Owner: -
4410--
4411
4412CREATE INDEX objectslogs_otype_idx ON public.objectslogs USING btree (otype);
4413
4414
4415--
4416-- Name: person_rev_idx; Type: INDEX; Schema: public; Owner: -
4417--
4418
4419CREATE INDEX person_rev_idx ON public."user" USING btree (rev);
4420
4421
4422--
4423-- Name: revaliases_as_idx; Type: INDEX; Schema: public; Owner: -
4424--
4425
4426CREATE INDEX revaliases_as_idx ON public.revaliases USING btree ("as");
4427
4428
4429--
4430-- Name: revaliases_as_lower_idx; Type: INDEX; Schema: public; Owner: -
4431--
4432
4433CREATE INDEX revaliases_as_lower_idx ON public.revaliases USING btree (lower("as"));
4434
4435
4436--
4437-- Name: revaliases_exported_idx; Type: INDEX; Schema: public; Owner: -
4438--
4439
4440CREATE INDEX revaliases_exported_idx ON public.revaliases USING btree (exported);
4441
4442
4443--
4444-- Name: revaliases_rev_idx; Type: INDEX; Schema: public; Owner: -
4445--
4446
4447CREATE INDEX revaliases_rev_idx ON public.revaliases USING btree (rev);
4448
4449
4450--
4451-- Name: service_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4452--
4453
4454CREATE INDEX service_attr_value_idx ON public.nethost_attributes USING btree (value);
4455
4456
4457--
4458-- Name: site_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4459--
4460
4461CREATE INDEX site_attr_value_idx ON public.site_attributes USING btree (value);
4462
4463
4464--
4465-- Name: site_exported_idx; Type: INDEX; Schema: public; Owner: -
4466--
4467
4468CREATE INDEX site_exported_idx ON public.site USING btree (exported);
4469
4470
4471--
4472-- Name: site_rev_idx; Type: INDEX; Schema: public; Owner: -
4473--
4474
4475CREATE UNIQUE INDEX site_rev_idx ON public.site USING btree (rev);
4476
4477
4478--
4479-- Name: stat_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4480--
4481
4482CREATE INDEX stat_attr_value_idx ON public.stat_attributes USING btree (value);
4483
4484
4485--
4486-- Name: stat_attributes_attr_fkey; Type: INDEX; Schema: public; Owner: -
4487--
4488
4489CREATE INDEX stat_attributes_attr_fkey ON public.stat_attributes USING btree (attr);
4490
4491
4492--
4493-- Name: stat_exported_idx; Type: INDEX; Schema: public; Owner: -
4494--
4495
4496CREATE INDEX stat_exported_idx ON public.stat USING btree (exported);
4497
4498
4499--
4500-- Name: stat_rev_idx; Type: INDEX; Schema: public; Owner: -
4501--
4502
4503CREATE UNIQUE INDEX stat_rev_idx ON public.stat USING btree (rev);
4504
4505
4506--
4507-- Name: user_attr_value_idx; Type: INDEX; Schema: public; Owner: -
4508--
4509
4510CREATE INDEX user_attr_value_idx ON public.user_attributes_base USING btree (value);
4511
4512
4513--
4514-- Name: user_expire_idx; Type: INDEX; Schema: public; Owner: -
4515--
4516
4517CREATE INDEX user_expire_idx ON public."user" USING btree (expire);
4518
4519
4520--
4521-- Name: user_exported_idx; Type: INDEX; Schema: public; Owner: -
4522--
4523
4524CREATE INDEX user_exported_idx ON public."user" USING btree (exported);
4525
4526
4527--
4528-- Name: address_attributes address_attributes_insert; Type: RULE; Schema: public; Owner: -
4529--
4530
4531CREATE RULE address_attributes_insert AS
4532    ON INSERT TO public.address_attributes DO INSTEAD  INSERT INTO public.address_attributes_base (value, attr, attr_key, okey)
4533  VALUES (new.value, new.attr, new.attr_key, new.okey);
4534
4535
4536--
4537-- Name: address_attributes address_attributes_update; Type: RULE; Schema: public; Owner: -
4538--
4539
4540CREATE RULE address_attributes_update AS
4541    ON UPDATE TO public.address_attributes DO INSTEAD  UPDATE public.address_attributes_base SET value = new.value, attr = new.attr, attr_key = new.attr_key, okey = new.okey
4542  WHERE ((address_attributes_base.attr_key = old.attr_key) AND (address_attributes_base.attr = old.attr));
4543
4544
4545--
4546-- Name: address_attributes address_atttributes_delete; Type: RULE; Schema: public; Owner: -
4547--
4548
4549CREATE RULE address_atttributes_delete AS
4550    ON DELETE TO public.address_attributes DO INSTEAD  DELETE FROM public.address_attributes_base
4551  WHERE ((address_attributes_base.attr_key = old.attr_key) AND (address_attributes_base.attr = old.attr));
4552
4553
4554--
4555-- Name: aliases_attributes aliases_attributes_insert; Type: RULE; Schema: public; Owner: -
4556--
4557
4558CREATE RULE aliases_attributes_insert AS
4559    ON INSERT TO public.aliases_attributes DO INSTEAD  INSERT INTO public.aliases_attributes_base (value, attr, okey)
4560  VALUES (new.value, new.attr, new.okey);
4561
4562
4563--
4564-- Name: aliases_attributes aliases_attributes_update; Type: RULE; Schema: public; Owner: -
4565--
4566
4567CREATE RULE aliases_attributes_update AS
4568    ON UPDATE TO public.aliases_attributes DO INSTEAD  UPDATE public.aliases_attributes_base SET value = new.value, attr = new.attr, attr_key = new.attr_key, okey = new.okey
4569  WHERE ((aliases_attributes_base.attr_key = old.attr_key) AND (aliases_attributes_base.attr = old.attr));
4570
4571
4572--
4573-- Name: aliases_attributes aliases_atttributes_delete; Type: RULE; Schema: public; Owner: -
4574--
4575
4576CREATE RULE aliases_atttributes_delete AS
4577    ON DELETE TO public.aliases_attributes DO INSTEAD  DELETE FROM public.aliases_attributes_base
4578  WHERE ((aliases_attributes_base.attr_key = old.attr_key) AND (aliases_attributes_base.attr = old.attr));
4579
4580
4581--
4582-- Name: group_attributes group_attributes_insert; Type: RULE; Schema: public; Owner: -
4583--
4584
4585CREATE RULE group_attributes_insert AS
4586    ON INSERT TO public.group_attributes DO INSTEAD  INSERT INTO public.group_attributes_base (value, attr, attr_key, okey)
4587  VALUES (new.value, new.attr, new.attr_key, new.okey);
4588
4589
4590--
4591-- Name: group_attributes group_attributes_update; Type: RULE; Schema: public; Owner: -
4592--
4593
4594CREATE RULE group_attributes_update AS
4595    ON UPDATE TO public.group_attributes DO INSTEAD  UPDATE public.group_attributes_base SET value = new.value, attr = new.attr, attr_key = new.attr_key, okey = new.okey
4596  WHERE ((group_attributes_base.attr_key = old.attr_key) AND (group_attributes_base.attr = old.attr));
4597
4598
4599--
4600-- Name: group_attributes group_atttributes_delete; Type: RULE; Schema: public; Owner: -
4601--
4602
4603CREATE RULE group_atttributes_delete AS
4604    ON DELETE TO public.group_attributes DO INSTEAD  DELETE FROM public.group_attributes_base
4605  WHERE ((group_attributes_base.attr_key = old.attr_key) AND (group_attributes_base.attr = old.attr));
4606
4607
4608--
4609-- Name: user_attributes user_attributes_insert; Type: RULE; Schema: public; Owner: -
4610--
4611
4612CREATE RULE user_attributes_insert AS
4613    ON INSERT TO public.user_attributes DO INSTEAD  INSERT INTO public.user_attributes_base (value, attr, attr_key, okey)
4614  VALUES (new.value, new.attr, new.attr_key, new.okey);
4615
4616
4617--
4618-- Name: user_attributes user_attributes_update; Type: RULE; Schema: public; Owner: -
4619--
4620
4621CREATE RULE user_attributes_update AS
4622    ON UPDATE TO public.user_attributes DO INSTEAD  UPDATE public.user_attributes_base SET value = new.value, attr = new.attr, attr_key = new.attr_key, okey = new.okey
4623  WHERE ((user_attributes_base.attr_key = old.attr_key) AND (user_attributes_base.attr = old.attr));
4624
4625
4626--
4627-- Name: user_attributes user_atttributes_delete; Type: RULE; Schema: public; Owner: -
4628--
4629
4630CREATE RULE user_atttributes_delete AS
4631    ON DELETE TO public.user_attributes DO INSTEAD  DELETE FROM public.user_attributes_base
4632  WHERE ((user_attributes_base.attr_key = old.attr_key) AND (user_attributes_base.attr = old.attr));
4633
4634
4635--
4636-- Name: accreq accreq_update_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4637--
4638
4639CREATE TRIGGER accreq_update_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.accreq FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4640
4641
4642--
4643-- Name: address_attributes_site address_attr_update_ref_a_s; Type: TRIGGER; Schema: public; Owner: -
4644--
4645
4646CREATE TRIGGER address_attr_update_ref_a_s AFTER INSERT OR DELETE OR UPDATE ON public.address_attributes_site FOR EACH ROW EXECUTE PROCEDURE public.address_attr_update_ref();
4647
4648
4649--
4650-- Name: address_attributes_base address_attr_update_ref_tg; Type: TRIGGER; Schema: public; Owner: -
4651--
4652
4653CREATE TRIGGER address_attr_update_ref_tg AFTER INSERT OR DELETE OR UPDATE ON public.address_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.address_attr_update_ref();
4654
4655
4656--
4657-- Name: address_attributes_base address_sort_fields_tg; Type: TRIGGER; Schema: public; Owner: -
4658--
4659
4660CREATE TRIGGER address_sort_fields_tg BEFORE INSERT OR DELETE OR UPDATE ON public.address_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.address_sort_fields();
4661
4662
4663--
4664-- Name: address address_update_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4665--
4666
4667CREATE TRIGGER address_update_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.address FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4668
4669
4670--
4671-- Name: address address_update_user_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4672--
4673
4674CREATE TRIGGER address_update_user_rev_tg AFTER INSERT OR DELETE OR UPDATE ON public.address FOR EACH ROW EXECUTE PROCEDURE public.address_update_user_rev();
4675
4676
4677--
4678-- Name: aliases_attributes_base aliases_attr_update; Type: TRIGGER; Schema: public; Owner: -
4679--
4680
4681CREATE TRIGGER aliases_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.aliases_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.aliases_attr_update_ref();
4682
4683
4684--
4685-- Name: aliases aliases_nickname_tg; Type: TRIGGER; Schema: public; Owner: -
4686--
4687
4688CREATE TRIGGER aliases_nickname_tg AFTER DELETE OR UPDATE ON public.aliases FOR EACH ROW EXECUTE PROCEDURE public.aliases_nickname();
4689
4690
4691--
4692-- Name: aliases aliases_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4693--
4694
4695CREATE TRIGGER aliases_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.aliases FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4696
4697
4698--
4699-- Name: aliases aliases_user_tg; Type: TRIGGER; Schema: public; Owner: -
4700--
4701
4702CREATE TRIGGER aliases_user_tg AFTER INSERT OR DELETE OR UPDATE ON public.aliases FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_aliases_f();
4703
4704
4705--
4706-- Name: user_attributes_groups department_group_upd_tg; Type: TRIGGER; Schema: public; Owner: -
4707--
4708
4709CREATE TRIGGER department_group_upd_tg AFTER INSERT OR UPDATE ON public.user_attributes_groups FOR EACH ROW EXECUTE PROCEDURE public.department_group_upd_f();
4710
4711
4712--
4713-- Name: employment_attributes employment_attr_update; Type: TRIGGER; Schema: public; Owner: -
4714--
4715
4716CREATE TRIGGER employment_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.employment_attributes FOR EACH ROW EXECUTE PROCEDURE public.employment_attr_update_ref();
4717
4718
4719--
4720-- Name: nethost_attributes_macs fmt_macaddr_tg; Type: TRIGGER; Schema: public; Owner: -
4721--
4722
4723CREATE TRIGGER fmt_macaddr_tg BEFORE INSERT OR UPDATE ON public.nethost_attributes_macs FOR EACH ROW EXECUTE PROCEDURE public.fmt_macaddr();
4724
4725
4726--
4727-- Name: group_attributes_base group_attr_update; Type: TRIGGER; Schema: public; Owner: -
4728--
4729
4730CREATE TRIGGER group_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.group_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.group_attr_update_ref();
4731
4732
4733--
4734-- Name: group_attributes_users group_attr_user_update_user_ref_tg; Type: TRIGGER; Schema: public; Owner: -
4735--
4736
4737CREATE TRIGGER group_attr_user_update_user_ref_tg AFTER INSERT OR DELETE OR UPDATE ON public.group_attributes_users FOR EACH ROW EXECUTE PROCEDURE public.group_attr_user_update_user_ref();
4738
4739
4740--
4741-- Name: group_attributes_sutypes group_attributes_sutypes_update_ref; Type: TRIGGER; Schema: public; Owner: -
4742--
4743
4744CREATE TRIGGER group_attributes_sutypes_update_ref AFTER INSERT OR DELETE OR UPDATE ON public.group_attributes_sutypes FOR EACH ROW EXECUTE PROCEDURE public.group_attr_update_ref();
4745
4746
4747--
4748-- Name: group_attributes_users group_attributes_users_update_ref; Type: TRIGGER; Schema: public; Owner: -
4749--
4750
4751CREATE TRIGGER group_attributes_users_update_ref AFTER INSERT OR DELETE OR UPDATE ON public.group_attributes_users FOR EACH ROW EXECUTE PROCEDURE public.group_attr_update_ref();
4752
4753
4754--
4755-- Name: group group_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4756--
4757
4758CREATE TRIGGER group_rev_tg BEFORE DELETE OR UPDATE ON public."group" FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4759
4760
4761--
4762-- Name: group_attributes_base group_sort_field_tg; Type: TRIGGER; Schema: public; Owner: -
4763--
4764
4765CREATE TRIGGER group_sort_field_tg BEFORE INSERT OR DELETE OR UPDATE ON public.group_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.group_sort_fields();
4766
4767
4768--
4769-- Name: nethost_attributes_ips nethost_attr_ip_update; Type: TRIGGER; Schema: public; Owner: -
4770--
4771
4772CREATE TRIGGER nethost_attr_ip_update AFTER INSERT OR DELETE OR UPDATE ON public.nethost_attributes_ips FOR EACH ROW EXECUTE PROCEDURE public.nethost_attr_update_ref();
4773
4774
4775--
4776-- Name: nethost_attributes_macs nethost_attr_mac_update; Type: TRIGGER; Schema: public; Owner: -
4777--
4778
4779CREATE TRIGGER nethost_attr_mac_update AFTER INSERT OR DELETE OR UPDATE ON public.nethost_attributes_macs FOR EACH ROW EXECUTE PROCEDURE public.nethost_attr_update_ref();
4780
4781
4782--
4783-- Name: nethost_attributes_nethosts nethost_attr_nethosts_update; Type: TRIGGER; Schema: public; Owner: -
4784--
4785
4786CREATE TRIGGER nethost_attr_nethosts_update AFTER INSERT OR DELETE OR UPDATE ON public.nethost_attributes_nethosts FOR EACH ROW EXECUTE PROCEDURE public.nethost_attr_update_ref();
4787
4788
4789--
4790-- Name: nethost_attributes nethost_attr_update; Type: TRIGGER; Schema: public; Owner: -
4791--
4792
4793CREATE TRIGGER nethost_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.nethost_attributes FOR EACH ROW EXECUTE PROCEDURE public.nethost_attr_update_ref();
4794
4795
4796--
4797-- Name: nethost_attributes_users nethost_attributes_users_update_ref; Type: TRIGGER; Schema: public; Owner: -
4798--
4799
4800CREATE TRIGGER nethost_attributes_users_update_ref AFTER INSERT OR DELETE OR UPDATE ON public.nethost_attributes_users FOR EACH ROW EXECUTE PROCEDURE public.nethost_attr_update_ref();
4801
4802
4803--
4804-- Name: nethost_attributes nethost_sort_field_tg; Type: TRIGGER; Schema: public; Owner: -
4805--
4806
4807CREATE TRIGGER nethost_sort_field_tg BEFORE INSERT OR DELETE OR UPDATE ON public.nethost_attributes FOR EACH ROW EXECUTE PROCEDURE public.nethost_sort_fields();
4808
4809
4810--
4811-- Name: nethost nethost_upd_zone_tg_del; Type: TRIGGER; Schema: public; Owner: -
4812--
4813
4814CREATE TRIGGER nethost_upd_zone_tg_del BEFORE DELETE ON public.nethost FOR EACH ROW EXECUTE PROCEDURE public.nethost_upd_zone();
4815
4816
4817--
4818-- Name: nethost nethost_upd_zone_tg_insupd; Type: TRIGGER; Schema: public; Owner: -
4819--
4820
4821CREATE TRIGGER nethost_upd_zone_tg_insupd AFTER INSERT OR UPDATE ON public.nethost FOR EACH ROW EXECUTE PROCEDURE public.nethost_upd_zone();
4822
4823
4824--
4825-- Name: nethost nethost_update_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4826--
4827
4828CREATE TRIGGER nethost_update_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.nethost FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4829
4830
4831--
4832-- Name: nethost_attributes_ips nethostipdel_upd_zone_tg; Type: TRIGGER; Schema: public; Owner: -
4833--
4834
4835CREATE TRIGGER nethostipdel_upd_zone_tg BEFORE DELETE ON public.nethost_attributes_ips FOR EACH ROW EXECUTE PROCEDURE public.nethostipdel_upd_zone();
4836
4837
4838--
4839-- Name: netzone_attributes netzone_attr_update; Type: TRIGGER; Schema: public; Owner: -
4840--
4841
4842CREATE TRIGGER netzone_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.netzone_attributes FOR EACH ROW EXECUTE PROCEDURE public.netzone_attr_update_ref();
4843
4844
4845--
4846-- Name: netzone_attributes_site netzone_attr_update_ref_a_s; Type: TRIGGER; Schema: public; Owner: -
4847--
4848
4849CREATE TRIGGER netzone_attr_update_ref_a_s AFTER INSERT OR DELETE OR UPDATE ON public.netzone_attributes_site FOR EACH ROW EXECUTE PROCEDURE public.netzone_attr_update_ref();
4850
4851
4852--
4853-- Name: netzone_attributes_netzone netzone_attr_update_ref_a_s; Type: TRIGGER; Schema: public; Owner: -
4854--
4855
4856CREATE TRIGGER netzone_attr_update_ref_a_s AFTER INSERT OR DELETE OR UPDATE ON public.netzone_attributes_netzone FOR EACH ROW EXECUTE PROCEDURE public.netzone_attr_update_ref();
4857
4858
4859--
4860-- Name: netzone_attributes netzone_sort_fields_tg; Type: TRIGGER; Schema: public; Owner: -
4861--
4862
4863CREATE TRIGGER netzone_sort_fields_tg BEFORE INSERT OR DELETE OR UPDATE ON public.netzone_attributes FOR EACH ROW EXECUTE PROCEDURE public.netzone_sort_fields();
4864
4865
4866--
4867-- Name: netzone netzone_update_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4868--
4869
4870CREATE TRIGGER netzone_update_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.netzone FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4871
4872
4873--
4874-- Name: user_attributes_base person_attr_update; Type: TRIGGER; Schema: public; Owner: -
4875--
4876
4877CREATE TRIGGER person_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.user_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.person_attr_update_ref();
4878
4879
4880--
4881-- Name: user_attributes_groups person_attr_update_ref_a_g; Type: TRIGGER; Schema: public; Owner: -
4882--
4883
4884CREATE TRIGGER person_attr_update_ref_a_g AFTER INSERT OR DELETE OR UPDATE ON public.user_attributes_groups FOR EACH ROW EXECUTE PROCEDURE public.person_attr_update_ref();
4885
4886
4887--
4888-- Name: user_attributes_site person_attr_update_ref_a_s; Type: TRIGGER; Schema: public; Owner: -
4889--
4890
4891CREATE TRIGGER person_attr_update_ref_a_s AFTER INSERT OR DELETE OR UPDATE ON public.user_attributes_site FOR EACH ROW EXECUTE PROCEDURE public.person_attr_update_ref();
4892
4893
4894--
4895-- Name: user_attributes_users person_attr_update_ref_a_u; Type: TRIGGER; Schema: public; Owner: -
4896--
4897
4898CREATE TRIGGER person_attr_update_ref_a_u AFTER INSERT OR DELETE OR UPDATE ON public.user_attributes_users FOR EACH ROW EXECUTE PROCEDURE public.person_attr_update_ref();
4899
4900
4901--
4902-- Name: user person_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4903--
4904
4905CREATE TRIGGER person_rev_tg BEFORE DELETE OR UPDATE ON public."user" FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4906
4907
4908--
4909-- Name: revaliases revaliases_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4910--
4911
4912CREATE TRIGGER revaliases_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.revaliases FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4913
4914
4915--
4916-- Name: revisions revisions_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4917--
4918
4919CREATE TRIGGER revisions_rev_tg AFTER DELETE OR UPDATE ON public.revisions FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4920
4921
4922--
4923-- Name: service_attributes serivce_attr_update; Type: TRIGGER; Schema: public; Owner: -
4924--
4925
4926CREATE TRIGGER serivce_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.service_attributes FOR EACH ROW EXECUTE PROCEDURE public.service_attr_update_ref();
4927
4928
4929--
4930-- Name: service_attributes_users service_attributes_users_update_ref; Type: TRIGGER; Schema: public; Owner: -
4931--
4932
4933CREATE TRIGGER service_attributes_users_update_ref AFTER INSERT OR DELETE OR UPDATE ON public.service_attributes_users FOR EACH ROW EXECUTE PROCEDURE public.service_attr_update_ref();
4934
4935
4936--
4937-- Name: service service_rev_tg; Type: TRIGGER; Schema: public; Owner: -
4938--
4939
4940CREATE TRIGGER service_rev_tg BEFORE INSERT OR DELETE OR UPDATE ON public.service FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4941
4942
4943--
4944-- Name: service_attributes service_sort_field_tg; Type: TRIGGER; Schema: public; Owner: -
4945--
4946
4947CREATE TRIGGER service_sort_field_tg BEFORE INSERT OR DELETE OR UPDATE ON public.service_attributes FOR EACH ROW EXECUTE PROCEDURE public.service_sort_fields();
4948
4949
4950--
4951-- Name: settings settings_revision_tg; Type: TRIGGER; Schema: public; Owner: -
4952--
4953
4954CREATE TRIGGER settings_revision_tg BEFORE INSERT OR DELETE OR UPDATE ON public.settings FOR EACH ROW EXECUTE PROCEDURE public.rev_tg_f();
4955
4956
4957--
4958-- Name: site_attributes site_attr_update; Type: TRIGGER; Schema: public; Owner: -
4959--
4960
4961CREATE TRIGGER site_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.site_attributes FOR EACH ROW EXECUTE PROCEDURE public.site_attr_update_ref();
4962
4963
4964--
4965-- Name: stat_attributes stat_attr_update; Type: TRIGGER; Schema: public; Owner: -
4966--
4967
4968CREATE TRIGGER stat_attr_update AFTER INSERT OR DELETE OR UPDATE ON public.stat_attributes FOR EACH ROW EXECUTE PROCEDURE public.stat_attr_update_ref();
4969
4970
4971--
4972-- Name: site update_address_site_tg; Type: TRIGGER; Schema: public; Owner: -
4973--
4974
4975CREATE TRIGGER update_address_site_tg BEFORE INSERT OR DELETE OR UPDATE ON public.site FOR EACH ROW EXECUTE PROCEDURE public.update_address_site();
4976
4977
4978--
4979-- Name: user_attributes_base user_sort_field_tg; Type: TRIGGER; Schema: public; Owner: -
4980--
4981
4982CREATE TRIGGER user_sort_field_tg BEFORE INSERT OR DELETE OR UPDATE ON public.user_attributes_base FOR EACH ROW EXECUTE PROCEDURE public.user_sort_fields();
4983
4984
4985--
4986-- Name: accreq_attributes accreq_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4987--
4988
4989ALTER TABLE ONLY public.accreq_attributes
4990    ADD CONSTRAINT accreq_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public.accreq(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
4991
4992
4993--
4994-- Name: accreq_attributes accreq_attributes_list_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
4995--
4996
4997ALTER TABLE ONLY public.accreq_attributes
4998    ADD CONSTRAINT accreq_attributes_list_attr_fkey FOREIGN KEY (attr) REFERENCES public.accreq_attributes_list(canonical);
4999
5000
5001--
5002-- Name: address_attributes_base address_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5003--
5004
5005ALTER TABLE ONLY public.address_attributes_base
5006    ADD CONSTRAINT address_attr_fkey FOREIGN KEY (attr) REFERENCES public.address_attributes_list(canonical) ON UPDATE CASCADE;
5007
5008
5009--
5010-- Name: address_attributes_base address_attributes_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5011--
5012
5013ALTER TABLE ONLY public.address_attributes_base
5014    ADD CONSTRAINT address_attributes_okey_fkey FOREIGN KEY (okey) REFERENCES public.address(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5015
5016
5017--
5018-- Name: address_attributes_site address_attributes_site_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5019--
5020
5021ALTER TABLE ONLY public.address_attributes_site
5022    ADD CONSTRAINT address_attributes_site_attr_fkey FOREIGN KEY (attr) REFERENCES public.address_attributes_list_site(canonical) ON UPDATE CASCADE;
5023
5024
5025--
5026-- Name: address_attributes_site address_attributes_site_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5027--
5028
5029ALTER TABLE ONLY public.address_attributes_site
5030    ADD CONSTRAINT address_attributes_site_okey_fkey FOREIGN KEY (okey) REFERENCES public.address(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5031
5032
5033--
5034-- Name: address_attributes_site address_attributes_site_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5035--
5036
5037ALTER TABLE ONLY public.address_attributes_site
5038    ADD CONSTRAINT address_attributes_site_value_fkey FOREIGN KEY (value) REFERENCES public.site(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5039
5040
5041--
5042-- Name: address address_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5043--
5044
5045ALTER TABLE ONLY public.address
5046    ADD CONSTRAINT address_user_fkey FOREIGN KEY ("user") REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5047
5048
5049--
5050-- Name: aliases_attributes_base aliases_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5051--
5052
5053ALTER TABLE ONLY public.aliases_attributes_base
5054    ADD CONSTRAINT aliases_fkey FOREIGN KEY (okey) REFERENCES public.aliases(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5055
5056
5057--
5058-- Name: employment_attributes employment; Type: FK CONSTRAINT; Schema: public; Owner: -
5059--
5060
5061ALTER TABLE ONLY public.employment_attributes
5062    ADD CONSTRAINT employment FOREIGN KEY (okey) REFERENCES public.employment(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5063
5064
5065--
5066-- Name: employment employment_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5067--
5068
5069ALTER TABLE ONLY public.employment
5070    ADD CONSTRAINT employment_user_fkey FOREIGN KEY ("user") REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5071
5072
5073--
5074-- Name: group_attributes_base group_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5075--
5076
5077ALTER TABLE ONLY public.group_attributes_base
5078    ADD CONSTRAINT group_attr_fkey FOREIGN KEY (attr) REFERENCES public.group_attributes_list(canonical) ON UPDATE CASCADE;
5079
5080
5081--
5082-- Name: group_attributes_base group_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5083--
5084
5085ALTER TABLE ONLY public.group_attributes_base
5086    ADD CONSTRAINT group_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public."group"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5087
5088
5089--
5090-- Name: group_attributes_sutypes group_attr_sutypes_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5091--
5092
5093ALTER TABLE ONLY public.group_attributes_sutypes
5094    ADD CONSTRAINT group_attr_sutypes_okey_fkey FOREIGN KEY (okey) REFERENCES public."group"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5095
5096
5097--
5098-- Name: group_attributes_users group_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5099--
5100
5101ALTER TABLE ONLY public.group_attributes_users
5102    ADD CONSTRAINT group_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public."group"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5103
5104
5105--
5106-- Name: group_attributes_sutypes group_attributes_sutypes_attr; Type: FK CONSTRAINT; Schema: public; Owner: -
5107--
5108
5109ALTER TABLE ONLY public.group_attributes_sutypes
5110    ADD CONSTRAINT group_attributes_sutypes_attr FOREIGN KEY (attr) REFERENCES public.group_attributes_list(canonical) ON UPDATE CASCADE;
5111
5112
5113--
5114-- Name: group_attributes_sutypes group_attributes_sutypes_sutype_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5115--
5116
5117ALTER TABLE ONLY public.group_attributes_sutypes
5118    ADD CONSTRAINT group_attributes_sutypes_sutype_fkey FOREIGN KEY (value) REFERENCES public.su_type(name) ON UPDATE CASCADE ON DELETE CASCADE;
5119
5120
5121--
5122-- Name: group_attributes_users group_attributes_users_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5123--
5124
5125ALTER TABLE ONLY public.group_attributes_users
5126    ADD CONSTRAINT group_attributes_users_attr_fkey FOREIGN KEY (attr) REFERENCES public.group_attributes_list(canonical) ON UPDATE CASCADE;
5127
5128
5129--
5130-- Name: group_attributes_users group_attributes_users_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5131--
5132
5133ALTER TABLE ONLY public.group_attributes_users
5134    ADD CONSTRAINT group_attributes_users_user_fkey FOREIGN KEY (value) REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5135
5136
5137--
5138-- Name: nethost_attributes_ips nethost_attr_ip_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5139--
5140
5141ALTER TABLE ONLY public.nethost_attributes_ips
5142    ADD CONSTRAINT nethost_attr_ip_fkey FOREIGN KEY (okey) REFERENCES public.nethost(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5143
5144
5145--
5146-- Name: nethost_attributes_macs nethost_attr_mac_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5147--
5148
5149ALTER TABLE ONLY public.nethost_attributes_macs
5150    ADD CONSTRAINT nethost_attr_mac_fkey FOREIGN KEY (okey) REFERENCES public.nethost(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5151
5152
5153--
5154-- Name: nethost_attributes_nethosts nethost_attr_nethosts_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5155--
5156
5157ALTER TABLE ONLY public.nethost_attributes_nethosts
5158    ADD CONSTRAINT nethost_attr_nethosts_fkey FOREIGN KEY (okey) REFERENCES public.nethost(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5159
5160
5161--
5162-- Name: nethost_attributes_nethosts nethost_attr_nethosts_nethosts; Type: FK CONSTRAINT; Schema: public; Owner: -
5163--
5164
5165ALTER TABLE ONLY public.nethost_attributes_nethosts
5166    ADD CONSTRAINT nethost_attr_nethosts_nethosts FOREIGN KEY (value) REFERENCES public.nethost(name) ON UPDATE CASCADE ON DELETE CASCADE;
5167
5168
5169--
5170-- Name: nethost_attributes nethost_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5171--
5172
5173ALTER TABLE ONLY public.nethost_attributes
5174    ADD CONSTRAINT nethost_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.nethost(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5175
5176
5177--
5178-- Name: nethost_attributes_users nethost_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5179--
5180
5181ALTER TABLE ONLY public.nethost_attributes_users
5182    ADD CONSTRAINT nethost_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.nethost(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5183
5184
5185--
5186-- Name: nethost_attributes nethost_attributes_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5187--
5188
5189ALTER TABLE ONLY public.nethost_attributes
5190    ADD CONSTRAINT nethost_attributes_attr_fkey FOREIGN KEY (attr) REFERENCES public.nethost_attributes_list(canonical) ON UPDATE CASCADE;
5191
5192
5193--
5194-- Name: nethost_attributes_users nethost_attributes_users_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5195--
5196
5197ALTER TABLE ONLY public.nethost_attributes_users
5198    ADD CONSTRAINT nethost_attributes_users_attr_fkey FOREIGN KEY (attr) REFERENCES public.nethost_attributes_list(canonical) ON UPDATE CASCADE;
5199
5200
5201--
5202-- Name: nethost_attributes_users nethost_attributes_users_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5203--
5204
5205ALTER TABLE ONLY public.nethost_attributes_users
5206    ADD CONSTRAINT nethost_attributes_users_user_fkey FOREIGN KEY (value) REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5207
5208
5209--
5210-- Name: netzone_attributes netzone_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5211--
5212
5213ALTER TABLE ONLY public.netzone_attributes
5214    ADD CONSTRAINT netzone_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.netzone(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5215
5216
5217--
5218-- Name: netzone_attributes netzone_attributes_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5219--
5220
5221ALTER TABLE ONLY public.netzone_attributes
5222    ADD CONSTRAINT netzone_attributes_attr_fkey FOREIGN KEY (attr) REFERENCES public.netzone_attributes_list(canonical) ON UPDATE CASCADE;
5223
5224
5225--
5226-- Name: netzone_attributes_netzone netzone_attributes_netzone_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5227--
5228
5229ALTER TABLE ONLY public.netzone_attributes_netzone
5230    ADD CONSTRAINT netzone_attributes_netzone_attr_fkey FOREIGN KEY (attr) REFERENCES public.netzone_attributes_list(canonical) ON UPDATE CASCADE;
5231
5232
5233--
5234-- Name: netzone_attributes_netzone netzone_attributes_netzone_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5235--
5236
5237ALTER TABLE ONLY public.netzone_attributes_netzone
5238    ADD CONSTRAINT netzone_attributes_netzone_okey_fkey FOREIGN KEY (okey) REFERENCES public.netzone(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5239
5240
5241--
5242-- Name: netzone_attributes_netzone netzone_attributes_netzone_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5243--
5244
5245ALTER TABLE ONLY public.netzone_attributes_netzone
5246    ADD CONSTRAINT netzone_attributes_netzone_value_fkey FOREIGN KEY (value) REFERENCES public.netzone(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5247
5248
5249--
5250-- Name: netzone_attributes_site netzone_attributes_site_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5251--
5252
5253ALTER TABLE ONLY public.netzone_attributes_site
5254    ADD CONSTRAINT netzone_attributes_site_attr_fkey FOREIGN KEY (attr) REFERENCES public.netzone_attributes_list(canonical) ON UPDATE CASCADE;
5255
5256
5257--
5258-- Name: netzone_attributes_site netzone_attributes_site_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5259--
5260
5261ALTER TABLE ONLY public.netzone_attributes_site
5262    ADD CONSTRAINT netzone_attributes_site_okey_fkey FOREIGN KEY (okey) REFERENCES public.netzone(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5263
5264
5265--
5266-- Name: netzone_attributes_site netzone_attributes_site_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5267--
5268
5269ALTER TABLE ONLY public.netzone_attributes_site
5270    ADD CONSTRAINT netzone_attributes_site_value_fkey FOREIGN KEY (value) REFERENCES public.site(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5271
5272
5273--
5274-- Name: passwordreset password_reset_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5275--
5276
5277ALTER TABLE ONLY public.passwordreset
5278    ADD CONSTRAINT password_reset_user_fkey FOREIGN KEY ("user") REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5279
5280
5281--
5282-- Name: request_attributes request_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5283--
5284
5285ALTER TABLE ONLY public.request_attributes
5286    ADD CONSTRAINT request_id_fkey FOREIGN KEY (reqid) REFERENCES public.request(id) ON UPDATE CASCADE ON DELETE CASCADE;
5287
5288
5289--
5290-- Name: request request_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5291--
5292
5293ALTER TABLE ONLY public.request
5294    ADD CONSTRAINT request_name_fkey FOREIGN KEY (name) REFERENCES public.accreq(name) ON UPDATE CASCADE ON DELETE CASCADE;
5295
5296
5297--
5298-- Name: request request_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5299--
5300
5301ALTER TABLE ONLY public.request
5302    ADD CONSTRAINT request_user_fkey FOREIGN KEY ("user") REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE SET NULL;
5303
5304
5305--
5306-- Name: revaliases revaliase_name_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5307--
5308
5309ALTER TABLE ONLY public.revaliases
5310    ADD CONSTRAINT revaliase_name_user_fkey FOREIGN KEY (name) REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5311
5312
5313--
5314-- Name: service_attributes service_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5315--
5316
5317ALTER TABLE ONLY public.service_attributes
5318    ADD CONSTRAINT service_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.service(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5319
5320
5321--
5322-- Name: service_attributes_users service_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5323--
5324
5325ALTER TABLE ONLY public.service_attributes_users
5326    ADD CONSTRAINT service_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.service(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5327
5328
5329--
5330-- Name: service_attributes service_attributes_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5331--
5332
5333ALTER TABLE ONLY public.service_attributes
5334    ADD CONSTRAINT service_attributes_attr_fkey FOREIGN KEY (attr) REFERENCES public.service_attributes_list(canonical) ON UPDATE CASCADE;
5335
5336
5337--
5338-- Name: service_attributes_users service_attributes_users_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5339--
5340
5341ALTER TABLE ONLY public.service_attributes_users
5342    ADD CONSTRAINT service_attributes_users_attr_fkey FOREIGN KEY (attr) REFERENCES public.service_attributes_list(canonical) ON UPDATE CASCADE;
5343
5344
5345--
5346-- Name: service_attributes_users service_attributes_users_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5347--
5348
5349ALTER TABLE ONLY public.service_attributes_users
5350    ADD CONSTRAINT service_attributes_users_user_fkey FOREIGN KEY (value) REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE;
5351
5352
5353--
5354-- Name: site_attributes site_attr_users_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5355--
5356
5357ALTER TABLE ONLY public.site_attributes
5358    ADD CONSTRAINT site_attr_users_okey_fkey FOREIGN KEY (okey) REFERENCES public.site(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5359
5360
5361--
5362-- Name: site_attributes site_attributes_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5363--
5364
5365ALTER TABLE ONLY public.site_attributes
5366    ADD CONSTRAINT site_attributes_attr_fkey FOREIGN KEY (attr) REFERENCES public.site_attributes_list(canonical) ON UPDATE CASCADE;
5367
5368
5369--
5370-- Name: stat_attributes stat; Type: FK CONSTRAINT; Schema: public; Owner: -
5371--
5372
5373ALTER TABLE ONLY public.stat_attributes
5374    ADD CONSTRAINT stat FOREIGN KEY (okey) REFERENCES public.stat(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5375
5376
5377--
5378-- Name: statsentry stat; Type: FK CONSTRAINT; Schema: public; Owner: -
5379--
5380
5381ALTER TABLE ONLY public.statsentry
5382    ADD CONSTRAINT stat FOREIGN KEY (okey) REFERENCES public.stat(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5383
5384
5385--
5386-- Name: statvalues statvalues_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5387--
5388
5389ALTER TABLE ONLY public.statvalues
5390    ADD CONSTRAINT statvalues_fkey FOREIGN KEY (sid) REFERENCES public.statsentry(id);
5391
5392
5393--
5394-- Name: user_attributes_base user_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5395--
5396
5397ALTER TABLE ONLY public.user_attributes_base
5398    ADD CONSTRAINT user_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public."user"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5399
5400
5401--
5402-- Name: user_attributes_base user_attributes_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5403--
5404
5405ALTER TABLE ONLY public.user_attributes_base
5406    ADD CONSTRAINT user_attributes_attr_fkey FOREIGN KEY (attr) REFERENCES public.user_attributes_list(canonical) ON UPDATE CASCADE;
5407
5408
5409--
5410-- Name: user_attributes_groups user_attributes_groups_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5411--
5412
5413ALTER TABLE ONLY public.user_attributes_groups
5414    ADD CONSTRAINT user_attributes_groups_attr_fkey FOREIGN KEY (attr) REFERENCES public.user_attributes_list(canonical) ON UPDATE CASCADE;
5415
5416
5417--
5418-- Name: user_attributes_groups user_attributes_groups_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5419--
5420
5421ALTER TABLE ONLY public.user_attributes_groups
5422    ADD CONSTRAINT user_attributes_groups_value_fkey FOREIGN KEY (value) REFERENCES public."group"(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5423
5424
5425--
5426-- Name: user_attributes_site user_attributes_site_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5427--
5428
5429ALTER TABLE ONLY public.user_attributes_site
5430    ADD CONSTRAINT user_attributes_site_attr_fkey FOREIGN KEY (attr) REFERENCES public.user_attributes_list(canonical) ON UPDATE CASCADE;
5431
5432
5433--
5434-- Name: user_attributes_site user_attributes_site_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5435--
5436
5437ALTER TABLE ONLY public.user_attributes_site
5438    ADD CONSTRAINT user_attributes_site_value_fkey FOREIGN KEY (value) REFERENCES public.site(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5439
5440
5441--
5442-- Name: user_attributes_users user_attributes_users_attr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5443--
5444
5445ALTER TABLE ONLY public.user_attributes_users
5446    ADD CONSTRAINT user_attributes_users_attr_fkey FOREIGN KEY (attr) REFERENCES public.user_attributes_list(canonical) ON UPDATE CASCADE;
5447
5448
5449--
5450-- Name: user_attributes_users user_attributes_users_value_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5451--
5452
5453ALTER TABLE ONLY public.user_attributes_users
5454    ADD CONSTRAINT user_attributes_users_value_fkey FOREIGN KEY (value) REFERENCES public."user"(name) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
5455
5456
5457--
5458-- Name: user_attributes_site user_site_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5459--
5460
5461ALTER TABLE ONLY public.user_attributes_site
5462    ADD CONSTRAINT user_site_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public."user"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5463
5464
5465--
5466-- Name: user_attributes_users user_users_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5467--
5468
5469ALTER TABLE ONLY public.user_attributes_users
5470    ADD CONSTRAINT user_users_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public."user"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5471
5472
5473--
5474-- Name: user_attributes_groups user_users_attr_okey_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
5475--
5476
5477ALTER TABLE ONLY public.user_attributes_groups
5478    ADD CONSTRAINT user_users_attr_okey_fkey FOREIGN KEY (okey) REFERENCES public."user"(ikey) ON UPDATE CASCADE ON DELETE CASCADE;
5479
5480
5481--
5482-- PostgreSQL database dump complete
5483--
5484
5485
5486INSERT INTO public.settings (varname, val) VALUES ('schema_version', '28');
Note: See TracBrowser for help on using the repository browser.