comparison db_schema/stammdaten_schema.sql @ 866:d47e6b8f3897

Reorganise database setup scripts. First step towards better readability.
author Tom Gottfried <tom@intevation.de>
date Fri, 05 Feb 2016 17:01:28 +0100
parents
children 66069d69d6ee
comparison
equal deleted inserted replaced
865:186d30e5b44a 866:d47e6b8f3897
1 \set ON_ERROR_STOP on
2
3 BEGIN;
4
5 SET statement_timeout = 0;
6 SET lock_timeout = 0;
7 SET client_encoding = 'UTF8';
8 SET standard_conforming_strings = on;
9 SET check_function_bodies = false;
10 SET client_min_messages = warning;
11
12
13 CREATE SCHEMA stammdaten;
14
15 SET search_path = stammdaten, pg_catalog;
16
17
18 CREATE FUNCTION get_media_from_media_desk(media_desk character varying) RETURNS character varying
19 LANGUAGE plpgsql
20 AS $$
21 declare
22 result character varying(100);
23 d00 smallint;
24 d01 smallint;
25 d02 smallint;
26 d03 smallint;
27 begin
28 if media_desk like 'D: %' then
29 d00 := substring(media_desk,4,2);
30 d01 := substring(media_desk,7,2);
31 d02 := substring(media_desk,10,2);
32 d03 := substring(media_desk,13,2);
33 if d00 = '00' then
34 result := null;
35 else
36 if d01 = '00' then
37 select s00.beschreibung into result FROM stammdaten.deskriptoren s00
38 where s00.ebene = 0 and s00.sn = d00::smallint;
39 else
40 if d02 = '00' or d00 <> '01' then
41 select s01.beschreibung into result FROM stammdaten.deskriptoren s01
42 where s01.ebene = 1 and s01.sn = d01::smallint
43 and s01.vorgaenger =
44 (select s00.id FROM stammdaten.deskriptoren s00
45 where s00.ebene = 0 and s00.sn = d00::smallint);
46 else
47 if d03 = '00' then
48 select s02.beschreibung into result FROM stammdaten.deskriptoren s02
49 where s02.ebene = 2 and s02.sn = d02::smallint
50 and s02.vorgaenger =
51 (select s01.id FROM stammdaten.deskriptoren s01
52 where s01.ebene = 1 and s01.sn = d01::smallint
53 and s01.vorgaenger =
54 (select s00.id FROM stammdaten.deskriptoren s00
55 where s00.ebene = 0 and s00.sn = d00::smallint));
56 else
57 select s03.beschreibung into result FROM stammdaten.deskriptoren s03
58 where s03.ebene = 3 and s03.sn = d03::smallint
59 and s03.vorgaenger =
60 (select s02.id FROM stammdaten.deskriptoren s02
61 where s02.ebene = 2 and s02.sn = d02::smallint
62 and s02.vorgaenger =
63 (select s01.id FROM stammdaten.deskriptoren s01
64 where s01.ebene = 1 and s01.sn = d01::smallint
65 and s01.vorgaenger =
66 (select s00.id FROM stammdaten.deskriptoren s00
67 where s00.ebene = 0 and s00.sn = d00::smallint)));
68 end if;
69 end if;
70 end if;
71 end if;
72 else
73 result := null;
74 end if;
75 return (result);
76 end;
77 $$;
78
79
80 CREATE TABLE auth (
81 id integer NOT NULL,
82 ldap_group character varying(40) NOT NULL,
83 netzbetreiber_id character varying(2),
84 mst_id character varying(5),
85 labor_mst_id character varying(5),
86 funktion_id smallint
87 );
88
89
90 --
91 -- Name: auth_funktion; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
92 --
93
94 CREATE TABLE auth_funktion (
95 id smallint NOT NULL,
96 funktion character varying(40)
97 );
98
99
100 --
101 -- Name: auth_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
102 --
103
104 CREATE SEQUENCE auth_id_seq
105 START WITH 1
106 INCREMENT BY 1
107 NO MINVALUE
108 NO MAXVALUE
109 CACHE 1;
110
111
112 --
113 -- Name: auth_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
114 --
115
116 ALTER SEQUENCE auth_id_seq OWNED BY auth.id;
117
118
119 --
120 -- Name: auth_id_seq1; Type: SEQUENCE; Schema: stammdaten; Owner: -
121 --
122
123 CREATE SEQUENCE auth_id_seq1
124 START WITH 1
125 INCREMENT BY 1
126 NO MINVALUE
127 NO MAXVALUE
128 CACHE 1;
129
130
131 --
132 -- Name: auth_id_seq1; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
133 --
134
135 ALTER SEQUENCE auth_id_seq1 OWNED BY auth.id;
136
137
138 --
139 -- Name: auth_lst_umw; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
140 --
141
142 CREATE TABLE auth_lst_umw (
143 id integer NOT NULL,
144 lst_id character varying(5),
145 umw_id character varying(3)
146 );
147
148
149 --
150 -- Name: auth_lst_umw_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
151 --
152
153 CREATE SEQUENCE auth_lst_umw_id_seq
154 START WITH 1
155 INCREMENT BY 1
156 NO MINVALUE
157 NO MAXVALUE
158 CACHE 1;
159
160
161 --
162 -- Name: auth_lst_umw_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
163 --
164
165 ALTER SEQUENCE auth_lst_umw_id_seq OWNED BY auth_lst_umw.id;
166
167
168 --
169 -- Name: datenbasis; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
170 --
171
172 CREATE TABLE datenbasis (
173 id integer NOT NULL,
174 beschreibung character varying(30),
175 datenbasis character varying(6)
176 );
177
178
179 --
180 -- Name: datenbasis_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
181 --
182
183 CREATE SEQUENCE datenbasis_id_seq
184 START WITH 1
185 INCREMENT BY 1
186 NO MINVALUE
187 NO MAXVALUE
188 CACHE 1;
189
190
191 --
192 -- Name: datenbasis_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
193 --
194
195 ALTER SEQUENCE datenbasis_id_seq OWNED BY datenbasis.id;
196
197
198 --
199 -- Name: datensatz_erzeuger; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
200 --
201
202 CREATE TABLE datensatz_erzeuger (
203 id integer NOT NULL,
204 netzbetreiber_id character varying(2),
205 da_erzeuger_id character varying(2),
206 mst_id character varying(5),
207 bezeichnung character varying(120),
208 letzte_aenderung timestamp without time zone
209 );
210
211
212 --
213 -- Name: datensatz_erzeuger_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
214 --
215
216 CREATE SEQUENCE datensatz_erzeuger_id_seq
217 START WITH 1
218 INCREMENT BY 1
219 NO MINVALUE
220 NO MAXVALUE
221 CACHE 1;
222
223
224 --
225 -- Name: datensatz_erzeuger_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
226 --
227
228 ALTER SEQUENCE datensatz_erzeuger_id_seq OWNED BY datensatz_erzeuger.id;
229
230
231 --
232 -- Name: de_vg; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
233 --
234
235 CREATE TABLE de_vg (
236 id integer NOT NULL,
237 use double precision,
238 rs character varying(12),
239 gf double precision,
240 rau_rs character varying(12),
241 gen character varying(50),
242 des character varying(75),
243 isn double precision,
244 bemerk character varying(75),
245 nambild character varying(16),
246 ags character varying(12),
247 rs_alt character varying(20),
248 wirksamkei date,
249 debkg_id character varying(16),
250 length numeric,
251 shape_area numeric,
252 geom public.geometry(MultiPolygon,4326)
253 );
254
255
256 --
257 -- Name: de_vg_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
258 --
259
260 CREATE SEQUENCE de_vg_id_seq
261 START WITH 1
262 INCREMENT BY 1
263 NO MINVALUE
264 NO MAXVALUE
265 CACHE 1;
266
267
268 --
269 -- Name: de_vg_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
270 --
271
272 ALTER SEQUENCE de_vg_id_seq OWNED BY de_vg.id;
273
274
275 --
276 -- Name: deskriptor_umwelt; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
277 --
278
279 CREATE TABLE deskriptor_umwelt (
280 id integer NOT NULL,
281 s00 integer NOT NULL,
282 s01 integer NOT NULL,
283 s02 integer,
284 s03 integer,
285 s04 integer,
286 s05 integer,
287 s06 integer,
288 s07 integer,
289 s08 integer,
290 s09 integer,
291 s10 integer,
292 s11 integer,
293 s12 integer,
294 umw_id character varying(3) NOT NULL
295 );
296
297
298 --
299 -- Name: deskriptoren; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
300 --
301
302 CREATE TABLE deskriptoren (
303 id integer NOT NULL,
304 vorgaenger integer,
305 ebene smallint,
306 s_xx integer,
307 sn smallint,
308 beschreibung character varying(100),
309 bedeutung character varying(300)
310 );
311
312
313 --
314 -- Name: deskriptoren_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
315 --
316
317 CREATE SEQUENCE deskriptoren_id_seq
318 START WITH 1
319 INCREMENT BY 1
320 NO MINVALUE
321 NO MAXVALUE
322 CACHE 1;
323
324
325 --
326 -- Name: deskriptoren_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
327 --
328
329 ALTER SEQUENCE deskriptoren_id_seq OWNED BY deskriptoren.id;
330
331
332 --
333 -- Name: favorite; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
334 --
335
336 CREATE TABLE favorite (
337 id integer NOT NULL,
338 user_id integer NOT NULL,
339 query_id integer NOT NULL
340 );
341
342
343 --
344 -- Name: favorite_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
345 --
346
347 CREATE SEQUENCE favorite_id_seq
348 START WITH 1
349 INCREMENT BY 1
350 NO MINVALUE
351 NO MAXVALUE
352 CACHE 1;
353
354
355 --
356 -- Name: favorite_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
357 --
358
359 ALTER SEQUENCE favorite_id_seq OWNED BY favorite.id;
360
361
362 --
363 -- Name: filter; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
364 --
365
366 CREATE TABLE filter (
367 id integer NOT NULL,
368 query_id integer NOT NULL,
369 data_index character varying(50) NOT NULL,
370 type character varying(10) NOT NULL,
371 label character varying(50) NOT NULL,
372 multiselect boolean
373 );
374
375
376 --
377 -- Name: filter_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
378 --
379
380 CREATE SEQUENCE filter_id_seq
381 START WITH 1
382 INCREMENT BY 1
383 NO MINVALUE
384 NO MAXVALUE
385 CACHE 1;
386
387
388 --
389 -- Name: filter_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
390 --
391
392 ALTER SEQUENCE filter_id_seq OWNED BY filter.id;
393
394
395 --
396 -- Name: filter_value; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
397 --
398
399 CREATE TABLE filter_value (
400 id integer NOT NULL,
401 query_id integer NOT NULL,
402 user_id integer NOT NULL,
403 filter_id integer NOT NULL,
404 value text
405 );
406
407
408 --
409 -- Name: filter_value_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
410 --
411
412 CREATE SEQUENCE filter_value_id_seq
413 START WITH 1
414 INCREMENT BY 1
415 NO MINVALUE
416 NO MAXVALUE
417 CACHE 1;
418
419
420 --
421 -- Name: filter_value_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
422 --
423
424 ALTER SEQUENCE filter_value_id_seq OWNED BY filter_value.id;
425
426
427 --
428 -- Name: koordinaten_art; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
429 --
430
431 CREATE TABLE koordinaten_art (
432 id integer NOT NULL,
433 koordinatenart character varying(50),
434 idf_geo_key character varying(1)
435 );
436
437
438 --
439 -- Name: koordinaten_art_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
440 --
441
442 CREATE SEQUENCE koordinaten_art_id_seq
443 START WITH 1
444 INCREMENT BY 1
445 NO MINVALUE
446 NO MAXVALUE
447 CACHE 1;
448
449
450 --
451 -- Name: koordinaten_art_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
452 --
453
454 ALTER SEQUENCE koordinaten_art_id_seq OWNED BY koordinaten_art.id;
455
456
457 --
458 -- Name: lada_user; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
459 --
460
461 CREATE TABLE lada_user (
462 id integer NOT NULL,
463 name character varying(80) NOT NULL
464 );
465
466
467 --
468 -- Name: lada_user_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
469 --
470
471 CREATE SEQUENCE lada_user_id_seq
472 START WITH 1
473 INCREMENT BY 1
474 NO MINVALUE
475 NO MAXVALUE
476 CACHE 1;
477
478
479 --
480 -- Name: lada_user_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
481 --
482
483 ALTER SEQUENCE lada_user_id_seq OWNED BY lada_user.id;
484
485
486 --
487 -- Name: mess_einheit; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
488 --
489
490 CREATE TABLE mess_einheit (
491 id integer NOT NULL,
492 beschreibung character varying(50),
493 einheit character varying(12),
494 eudf_messeinheit_id character varying(8),
495 umrechnungs_faktor_eudf bigint
496 );
497
498
499 --
500 -- Name: mess_einheit_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
501 --
502
503 CREATE SEQUENCE mess_einheit_id_seq
504 START WITH 1
505 INCREMENT BY 1
506 NO MINVALUE
507 NO MAXVALUE
508 CACHE 1;
509
510
511 --
512 -- Name: mess_einheit_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
513 --
514
515 ALTER SEQUENCE mess_einheit_id_seq OWNED BY mess_einheit.id;
516
517
518 --
519 -- Name: mess_methode; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
520 --
521
522 CREATE TABLE mess_methode (
523 id character varying(2) NOT NULL,
524 beschreibung character varying(300),
525 messmethode character varying(50)
526 );
527
528
529 --
530 -- Name: mess_stelle; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
531 --
532
533 CREATE TABLE mess_stelle (
534 id character varying(5) NOT NULL,
535 netzbetreiber_id character varying(2),
536 beschreibung character varying(300),
537 mess_stelle character varying(60),
538 mst_typ character varying(1),
539 amtskennung character varying(6)
540 );
541
542
543 --
544 -- Name: messgroesse; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
545 --
546
547 CREATE TABLE messgroesse (
548 id integer NOT NULL,
549 beschreibung character varying(300),
550 messgroesse character varying(50) NOT NULL,
551 default_farbe character varying(9),
552 idf_nuklid_key character varying(6),
553 ist_leitnuklid boolean DEFAULT false,
554 eudf_nuklid_id bigint,
555 kennung_bvl character varying(7)
556 );
557
558
559 --
560 -- Name: messgroesse_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
561 --
562
563 CREATE SEQUENCE messgroesse_id_seq
564 START WITH 1
565 INCREMENT BY 1
566 NO MINVALUE
567 NO MAXVALUE
568 CACHE 1;
569
570
571 --
572 -- Name: messgroesse_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
573 --
574
575 ALTER SEQUENCE messgroesse_id_seq OWNED BY messgroesse.id;
576
577
578 --
579 -- Name: messgroessen_gruppe; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
580 --
581
582 CREATE TABLE messgroessen_gruppe (
583 id integer NOT NULL,
584 bezeichnung character varying(80),
585 ist_leitnuklidgruppe character(1) DEFAULT NULL::bpchar
586 );
587
588
589 --
590 -- Name: messgroessen_gruppe_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
591 --
592
593 CREATE SEQUENCE messgroessen_gruppe_id_seq
594 START WITH 1
595 INCREMENT BY 1
596 NO MINVALUE
597 NO MAXVALUE
598 CACHE 1;
599
600
601 --
602 -- Name: messgroessen_gruppe_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
603 --
604
605 ALTER SEQUENCE messgroessen_gruppe_id_seq OWNED BY messgroessen_gruppe.id;
606
607
608 --
609 -- Name: messprogramm_kategorie; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
610 --
611
612 CREATE TABLE messprogramm_kategorie (
613 id integer NOT NULL,
614 netzbetreiber_id character varying(2),
615 mpl_id character varying(3),
616 bezeichnung character varying(120),
617 letzte_aenderung timestamp without time zone
618 );
619
620
621 --
622 -- Name: messprogramm_kategorie_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
623 --
624
625 CREATE SEQUENCE messprogramm_kategorie_id_seq
626 START WITH 1
627 INCREMENT BY 1
628 NO MINVALUE
629 NO MAXVALUE
630 CACHE 1;
631
632
633 --
634 -- Name: messprogramm_kategorie_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
635 --
636
637 ALTER SEQUENCE messprogramm_kategorie_id_seq OWNED BY messprogramm_kategorie.id;
638
639
640 --
641 -- Name: mg_grp; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
642 --
643
644 CREATE TABLE mg_grp (
645 messgroessengruppe_id integer NOT NULL,
646 messgroesse_id integer NOT NULL
647 );
648
649
650 --
651 -- Name: mmt_messgroesse_grp; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
652 --
653
654 CREATE TABLE mmt_messgroesse_grp (
655 messgroessengruppe_id integer NOT NULL,
656 mmt_id character varying(2) NOT NULL
657 );
658
659
660 --
661 -- Name: mmt_messgroesse; Type: VIEW; Schema: stammdaten; Owner: -
662 --
663
664 CREATE VIEW mmt_messgroesse AS
665 SELECT mmt_messgroesse_grp.mmt_id,
666 mg_grp.messgroesse_id
667 FROM mmt_messgroesse_grp,
668 mg_grp
669 WHERE (mg_grp.messgroessengruppe_id = mmt_messgroesse_grp.messgroessengruppe_id);
670
671
672 --
673 -- Name: netz_betreiber; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
674 --
675
676 CREATE TABLE netz_betreiber (
677 id character varying(2) NOT NULL,
678 netzbetreiber character varying(50),
679 idf_netzbetreiber character varying(1),
680 is_bmn boolean DEFAULT false,
681 mailverteiler character varying(512),
682 aktiv boolean DEFAULT false,
683 zust_mst_id character varying(5)
684 );
685
686
687 --
688 -- Name: ort; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
689 --
690
691 CREATE TABLE ort (
692 id integer NOT NULL,
693 netzbetreiber_id character varying(2),
694 ort_id character varying(10),
695 langtext character varying(100),
696 staat_id smallint,
697 gem_id character varying(8),
698 unscharf character(1) DEFAULT NULL::bpchar,
699 nuts_code character varying(10),
700 kda_id integer,
701 koord_x_extern character varying(22),
702 koord_y_extern character varying(22),
703 hoehe_land real,
704 letzte_aenderung timestamp without time zone DEFAULT now(),
705 latitude double precision,
706 longitude double precision,
707 geom public.geometry(Point,4326),
708 shape public.geometry(MultiPolygon,4326),
709 ort_typ smallint,
710 kurztext character varying(15),
711 berichtstext character varying(70),
712 zone character varying(1),
713 sektor character varying(2),
714 zustaendigkeit character varying(10),
715 mp_art character varying(10),
716 aktiv character(1),
717 anlage_id integer,
718 oz_id integer
719 );
720
721
722 --
723 -- Name: ort_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
724 --
725
726 CREATE SEQUENCE ort_id_seq
727 START WITH 1
728 INCREMENT BY 1
729 NO MINVALUE
730 NO MAXVALUE
731 CACHE 1;
732
733
734 --
735 -- Name: ort_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
736 --
737
738 ALTER SEQUENCE ort_id_seq OWNED BY ort.id;
739
740
741 --
742 -- Name: ort_typ; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
743 --
744
745 CREATE TABLE ort_typ (
746 id smallint NOT NULL,
747 ort_typ character varying(60)
748 );
749
750
751 --
752 -- Name: ortszuordnung_typ; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
753 --
754
755 CREATE TABLE ortszuordnung_typ (
756 id character(1) NOT NULL,
757 ortstyp character varying(60)
758 );
759
760
761 --
762 -- Name: pflicht_messgroesse; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
763 --
764
765 CREATE TABLE pflicht_messgroesse (
766 id integer NOT NULL,
767 messgroesse_id integer,
768 mmt_id character varying(2),
769 umw_id character varying(3),
770 datenbasis_id smallint NOT NULL
771 );
772
773
774 --
775 -- Name: pflicht_messgroesse_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
776 --
777
778 CREATE SEQUENCE pflicht_messgroesse_id_seq
779 START WITH 1
780 INCREMENT BY 1
781 NO MINVALUE
782 NO MAXVALUE
783 CACHE 1;
784
785
786 --
787 -- Name: pflicht_messgroesse_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
788 --
789
790 ALTER SEQUENCE pflicht_messgroesse_id_seq OWNED BY pflicht_messgroesse.id;
791
792
793 --
794 -- Name: proben_zusatz; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
795 --
796
797 CREATE TABLE proben_zusatz (
798 id character varying(3) NOT NULL,
799 meh_id integer,
800 beschreibung character varying(50) NOT NULL,
801 zusatzwert character varying(7) NOT NULL,
802 eudf_keyword character varying(40)
803 );
804
805
806 --
807 -- Name: probenart; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
808 --
809
810 CREATE TABLE probenart (
811 id integer NOT NULL,
812 beschreibung character varying(30),
813 probenart character varying(5) NOT NULL,
814 probenart_eudf_id character varying(1) NOT NULL
815 );
816
817
818 --
819 -- Name: probenart_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
820 --
821
822 CREATE SEQUENCE probenart_id_seq
823 START WITH 1
824 INCREMENT BY 1
825 NO MINVALUE
826 NO MAXVALUE
827 CACHE 1;
828
829
830 --
831 -- Name: probenart_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
832 --
833
834 ALTER SEQUENCE probenart_id_seq OWNED BY probenart.id;
835
836
837 --
838 -- Name: probenehmer; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
839 --
840
841 CREATE TABLE probenehmer (
842 id integer NOT NULL,
843 netzbetreiber_id character varying(2),
844 prn_id character varying(9),
845 bearbeiter character varying(25),
846 bemerkung character varying(60),
847 betrieb character varying(80),
848 bezeichnung character varying(80),
849 kurz_bezeichnung character varying(10),
850 ort character varying(20),
851 plz character varying(5),
852 strasse character varying(30),
853 telefon character varying(20),
854 tp character varying(3),
855 typ character(1),
856 letzte_aenderung timestamp without time zone
857 );
858
859
860 --
861 -- Name: probenehmer_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
862 --
863
864 CREATE SEQUENCE probenehmer_id_seq
865 START WITH 1
866 INCREMENT BY 1
867 NO MINVALUE
868 NO MAXVALUE
869 CACHE 1;
870
871
872 --
873 -- Name: probenehmer_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
874 --
875
876 ALTER SEQUENCE probenehmer_id_seq OWNED BY probenehmer.id;
877
878
879 --
880 -- Name: query; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
881 --
882
883 CREATE TABLE query (
884 id integer NOT NULL,
885 name character varying(80) NOT NULL,
886 type character varying(30) NOT NULL,
887 sql character varying(1500) NOT NULL,
888 description character varying(100)
889 );
890
891
892 --
893 -- Name: query_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
894 --
895
896 CREATE SEQUENCE query_id_seq
897 START WITH 1
898 INCREMENT BY 1
899 NO MINVALUE
900 NO MAXVALUE
901 CACHE 1;
902
903
904 --
905 -- Name: query_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
906 --
907
908 ALTER SEQUENCE query_id_seq OWNED BY query.id;
909
910
911 --
912 -- Name: result; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
913 --
914
915 CREATE TABLE result (
916 id integer NOT NULL,
917 query_id integer NOT NULL,
918 data_index character varying(50) NOT NULL,
919 header character varying(50) NOT NULL,
920 width integer,
921 flex boolean,
922 index integer
923 );
924
925
926 --
927 -- Name: result_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
928 --
929
930 CREATE SEQUENCE result_id_seq
931 START WITH 1
932 INCREMENT BY 1
933 NO MINVALUE
934 NO MAXVALUE
935 CACHE 1;
936
937
938 --
939 -- Name: result_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
940 --
941
942 ALTER SEQUENCE result_id_seq OWNED BY result.id;
943
944
945 --
946 -- Name: s_00_view; Type: VIEW; Schema: stammdaten; Owner: -
947 --
948
949 CREATE VIEW s_00_view AS
950 SELECT deskriptoren.s_xx AS s00,
951 deskriptoren.bedeutung,
952 deskriptoren.beschreibung,
953 deskriptoren.sn
954 FROM deskriptoren
955 WHERE (deskriptoren.ebene = 0);
956
957
958 --
959 -- Name: s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
960 --
961
962 CREATE VIEW s_01_view AS
963 SELECT d1.s_xx AS s01,
964 d2.s_xx AS s00,
965 d1.bedeutung,
966 d1.beschreibung,
967 d1.sn
968 FROM (deskriptoren d1
969 JOIN deskriptoren d2 ON ((d1.vorgaenger = d2.id)))
970 WHERE (d1.ebene = 1);
971
972
973 --
974 -- Name: s_02_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
975 --
976
977 CREATE VIEW s_02_s_01_view AS
978 SELECT d1.s_xx AS s01,
979 d2.s_xx AS s02
980 FROM (deskriptoren d1
981 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
982 WHERE (d2.ebene = 2);
983
984
985 --
986 -- Name: s_02_view; Type: VIEW; Schema: stammdaten; Owner: -
987 --
988
989 CREATE VIEW s_02_view AS
990 SELECT DISTINCT deskriptoren.s_xx AS s00,
991 deskriptoren.bedeutung,
992 deskriptoren.beschreibung,
993 deskriptoren.sn
994 FROM deskriptoren
995 WHERE (deskriptoren.ebene = 2);
996
997
998 --
999 -- Name: s_03_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1000 --
1001
1002 CREATE VIEW s_03_s_01_view AS
1003 SELECT d1.s_xx AS s01,
1004 d2.s_xx AS s03
1005 FROM (deskriptoren d1
1006 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1007 WHERE ((d2.ebene = 3) AND (d1.ebene = 1));
1008
1009
1010 --
1011 -- Name: s_03_view; Type: VIEW; Schema: stammdaten; Owner: -
1012 --
1013
1014 CREATE VIEW s_03_view AS
1015 SELECT d1.s_xx AS s03,
1016 d2.s_xx AS s02,
1017 d1.bedeutung,
1018 d1.beschreibung,
1019 d1.sn
1020 FROM (deskriptoren d1
1021 JOIN deskriptoren d2 ON ((d1.vorgaenger = d2.id)))
1022 WHERE ((d1.ebene = 3) AND (d2.ebene = 2))
1023 UNION
1024 SELECT d1.s_xx AS s03,
1025 NULL::integer AS s02,
1026 d1.bedeutung,
1027 d1.beschreibung,
1028 d1.sn
1029 FROM (deskriptoren d1
1030 JOIN deskriptoren d2 ON ((d1.vorgaenger = d2.id)))
1031 WHERE ((d1.ebene = 3) AND (d2.ebene = 1));
1032
1033
1034 --
1035 -- Name: s_04_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1036 --
1037
1038 CREATE VIEW s_04_s_01_view AS
1039 SELECT DISTINCT d1.s_xx AS s01,
1040 d2.s_xx AS s04
1041 FROM (deskriptoren d1
1042 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1043 WHERE (d2.ebene = 4);
1044
1045
1046 --
1047 -- Name: s_04_view; Type: VIEW; Schema: stammdaten; Owner: -
1048 --
1049
1050 CREATE VIEW s_04_view AS
1051 SELECT DISTINCT deskriptoren.s_xx AS s04,
1052 deskriptoren.bedeutung,
1053 deskriptoren.beschreibung,
1054 deskriptoren.sn
1055 FROM deskriptoren
1056 WHERE (deskriptoren.ebene = 4);
1057
1058
1059 --
1060 -- Name: s_05_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1061 --
1062
1063 CREATE VIEW s_05_s_01_view AS
1064 SELECT d1.s_xx AS s01,
1065 d2.s_xx AS s05
1066 FROM (deskriptoren d1
1067 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1068 WHERE (d2.ebene = 5);
1069
1070
1071 --
1072 -- Name: s_05_view; Type: VIEW; Schema: stammdaten; Owner: -
1073 --
1074
1075 CREATE VIEW s_05_view AS
1076 SELECT DISTINCT deskriptoren.s_xx AS s05,
1077 deskriptoren.bedeutung,
1078 deskriptoren.beschreibung,
1079 deskriptoren.sn
1080 FROM deskriptoren
1081 WHERE (deskriptoren.ebene = 5);
1082
1083
1084 --
1085 -- Name: s_06_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1086 --
1087
1088 CREATE VIEW s_06_s_01_view AS
1089 SELECT d1.s_xx AS s01,
1090 d2.s_xx AS s06
1091 FROM (deskriptoren d1
1092 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1093 WHERE (d2.ebene = 6);
1094
1095
1096 --
1097 -- Name: s_06_view; Type: VIEW; Schema: stammdaten; Owner: -
1098 --
1099
1100 CREATE VIEW s_06_view AS
1101 SELECT DISTINCT deskriptoren.s_xx AS s06,
1102 deskriptoren.bedeutung,
1103 deskriptoren.beschreibung,
1104 deskriptoren.sn
1105 FROM deskriptoren
1106 WHERE (deskriptoren.ebene = 6);
1107
1108
1109 --
1110 -- Name: s_07_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1111 --
1112
1113 CREATE VIEW s_07_s_01_view AS
1114 SELECT d1.s_xx AS s01,
1115 d2.s_xx AS s07
1116 FROM (deskriptoren d1
1117 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1118 WHERE (d2.ebene = 7);
1119
1120
1121 --
1122 -- Name: s_07_view; Type: VIEW; Schema: stammdaten; Owner: -
1123 --
1124
1125 CREATE VIEW s_07_view AS
1126 SELECT DISTINCT deskriptoren.s_xx AS s07,
1127 deskriptoren.bedeutung,
1128 deskriptoren.beschreibung,
1129 deskriptoren.sn
1130 FROM deskriptoren
1131 WHERE (deskriptoren.ebene = 7);
1132
1133
1134 --
1135 -- Name: s_08_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1136 --
1137
1138 CREATE VIEW s_08_s_01_view AS
1139 SELECT d1.s_xx AS s01,
1140 d2.s_xx AS s08
1141 FROM (deskriptoren d1
1142 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1143 WHERE (d2.ebene = 8);
1144
1145
1146 --
1147 -- Name: s_08_view; Type: VIEW; Schema: stammdaten; Owner: -
1148 --
1149
1150 CREATE VIEW s_08_view AS
1151 SELECT DISTINCT deskriptoren.s_xx AS s08,
1152 deskriptoren.bedeutung,
1153 deskriptoren.beschreibung,
1154 deskriptoren.sn
1155 FROM deskriptoren
1156 WHERE (deskriptoren.ebene = 8);
1157
1158
1159 --
1160 -- Name: s_09_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1161 --
1162
1163 CREATE VIEW s_09_s_01_view AS
1164 SELECT d1.s_xx AS s01,
1165 d2.s_xx AS s09
1166 FROM (deskriptoren d1
1167 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1168 WHERE (d2.ebene = 9);
1169
1170
1171 --
1172 -- Name: s_09_view; Type: VIEW; Schema: stammdaten; Owner: -
1173 --
1174
1175 CREATE VIEW s_09_view AS
1176 SELECT DISTINCT deskriptoren.s_xx AS s09,
1177 deskriptoren.bedeutung,
1178 deskriptoren.beschreibung,
1179 deskriptoren.sn
1180 FROM deskriptoren
1181 WHERE (deskriptoren.ebene = 9);
1182
1183
1184 --
1185 -- Name: s_10_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1186 --
1187
1188 CREATE VIEW s_10_s_01_view AS
1189 SELECT d1.s_xx AS s01,
1190 d2.s_xx AS s10
1191 FROM (deskriptoren d1
1192 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1193 WHERE (d2.ebene = 10);
1194
1195
1196 --
1197 -- Name: s_10_view; Type: VIEW; Schema: stammdaten; Owner: -
1198 --
1199
1200 CREATE VIEW s_10_view AS
1201 SELECT DISTINCT deskriptoren.s_xx AS s10,
1202 deskriptoren.bedeutung,
1203 deskriptoren.beschreibung,
1204 deskriptoren.sn
1205 FROM deskriptoren
1206 WHERE (deskriptoren.ebene = 10);
1207
1208
1209 --
1210 -- Name: s_11_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1211 --
1212
1213 CREATE VIEW s_11_s_01_view AS
1214 SELECT d1.s_xx AS s01,
1215 d2.s_xx AS s11
1216 FROM (deskriptoren d1
1217 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1218 WHERE (d2.ebene = 11);
1219
1220
1221 --
1222 -- Name: s_11_view; Type: VIEW; Schema: stammdaten; Owner: -
1223 --
1224
1225 CREATE VIEW s_11_view AS
1226 SELECT DISTINCT deskriptoren.s_xx AS s11,
1227 deskriptoren.bedeutung,
1228 deskriptoren.beschreibung,
1229 deskriptoren.sn
1230 FROM deskriptoren
1231 WHERE (deskriptoren.ebene = 11);
1232
1233
1234 --
1235 -- Name: s_12_s_01_view; Type: VIEW; Schema: stammdaten; Owner: -
1236 --
1237
1238 CREATE VIEW s_12_s_01_view AS
1239 SELECT d1.s_xx AS s01,
1240 d2.s_xx AS s12
1241 FROM (deskriptoren d1
1242 JOIN deskriptoren d2 ON ((d2.vorgaenger = d1.id)))
1243 WHERE (d2.ebene = 12);
1244
1245
1246 --
1247 -- Name: s_12_view; Type: VIEW; Schema: stammdaten; Owner: -
1248 --
1249
1250 CREATE VIEW s_12_view AS
1251 SELECT DISTINCT deskriptoren.s_xx AS s12,
1252 deskriptoren.bedeutung,
1253 deskriptoren.beschreibung,
1254 deskriptoren.sn
1255 FROM deskriptoren
1256 WHERE (deskriptoren.ebene = 12);
1257
1258
1259 --
1260 -- Name: staat; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1261 --
1262
1263 CREATE TABLE staat (
1264 id integer NOT NULL,
1265 staat character varying(50) NOT NULL,
1266 hkl_id smallint NOT NULL,
1267 staat_iso character varying(2) NOT NULL,
1268 staat_kurz character varying(5),
1269 eu character(1) DEFAULT NULL::bpchar,
1270 koord_x_extern character varying(22),
1271 koord_y_extern character varying(22),
1272 kda_id integer
1273 );
1274
1275
1276 --
1277 -- Name: staat_id_seq; Type: SEQUENCE; Schema: stammdaten; Owner: -
1278 --
1279
1280 CREATE SEQUENCE staat_id_seq
1281 START WITH 1
1282 INCREMENT BY 1
1283 NO MINVALUE
1284 NO MAXVALUE
1285 CACHE 1;
1286
1287
1288 --
1289 -- Name: staat_id_seq; Type: SEQUENCE OWNED BY; Schema: stammdaten; Owner: -
1290 --
1291
1292 ALTER SEQUENCE staat_id_seq OWNED BY staat.id;
1293
1294
1295 --
1296 -- Name: status_kombi; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1297 --
1298
1299 CREATE TABLE status_kombi (
1300 id integer NOT NULL,
1301 stufe_id integer,
1302 wert_id integer
1303 );
1304
1305
1306 --
1307 -- Name: status_reihenfolge; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1308 --
1309
1310 CREATE TABLE status_reihenfolge (
1311 id integer NOT NULL,
1312 von_id integer,
1313 zu_id integer
1314 );
1315
1316
1317 --
1318 -- Name: status_stufe; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1319 --
1320
1321 CREATE TABLE status_stufe (
1322 id integer NOT NULL,
1323 stufe character varying(50)
1324 );
1325
1326
1327 --
1328 -- Name: status_wert; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1329 --
1330
1331 CREATE TABLE status_wert (
1332 id integer NOT NULL,
1333 wert character varying(50)
1334 );
1335
1336
1337 --
1338 -- Name: umwelt; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1339 --
1340
1341 CREATE TABLE umwelt (
1342 id character varying(3) NOT NULL,
1343 beschreibung character varying(300),
1344 umwelt_bereich character varying(80) NOT NULL,
1345 meh_id integer
1346 );
1347
1348
1349 --
1350 -- Name: verwaltungseinheit; Type: TABLE; Schema: stammdaten; Owner: -; Tablespace:
1351 --
1352
1353 CREATE TABLE verwaltungseinheit (
1354 id character varying(8) NOT NULL,
1355 bundesland character varying(8) NOT NULL,
1356 kda_id integer,
1357 kreis character varying(8),
1358 nuts character varying(10),
1359 regbezirk character varying(8),
1360 bezeichnung character varying(80) NOT NULL,
1361 is_bundesland character(1) NOT NULL,
1362 is_gemeinde character(1) NOT NULL,
1363 is_landkreis character(1) NOT NULL,
1364 is_regbezirk character(1) NOT NULL,
1365 koord_x_extern character varying(22),
1366 koord_y_extern character varying(22),
1367 plz character varying(6),
1368 longitude double precision,
1369 latitude double precision
1370 );
1371
1372 --
1373 -- Name status_erreichbar; Type: VIEW; Schema: stammdaten; Owner: -;
1374 --
1375 CREATE VIEW status_erreichbar AS (
1376 SELECT DISTINCT k.wert_id,
1377 j.wert_id AS cur_wert,
1378 j.stufe_id AS cur_stufe
1379 FROM stammdaten.status_kombi k
1380 JOIN (SELECT r.zu_id,
1381 kom.wert_id,
1382 kom.stufe_id
1383 FROM stammdaten.status_reihenfolge r
1384 JOIN stammdaten.status_kombi kom
1385 ON kom.id = r.von_id) j
1386 ON j.zu_id = k.id
1387 );
1388
1389
1390 --
1391 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1392 --
1393
1394 ALTER TABLE ONLY auth ALTER COLUMN id SET DEFAULT nextval('auth_id_seq'::regclass);
1395
1396
1397 --
1398 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1399 --
1400
1401 ALTER TABLE ONLY datenbasis ALTER COLUMN id SET DEFAULT nextval('datenbasis_id_seq'::regclass);
1402
1403
1404 --
1405 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1406 --
1407
1408 ALTER TABLE ONLY datensatz_erzeuger ALTER COLUMN id SET DEFAULT nextval('datensatz_erzeuger_id_seq'::regclass);
1409
1410
1411 --
1412 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1413 --
1414
1415 ALTER TABLE ONLY de_vg ALTER COLUMN id SET DEFAULT nextval('de_vg_id_seq'::regclass);
1416
1417
1418 --
1419 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1420 --
1421
1422 ALTER TABLE ONLY deskriptoren ALTER COLUMN id SET DEFAULT nextval('deskriptoren_id_seq'::regclass);
1423
1424
1425 --
1426 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1427 --
1428
1429 ALTER TABLE ONLY favorite ALTER COLUMN id SET DEFAULT nextval('favorite_id_seq'::regclass);
1430
1431
1432 --
1433 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1434 --
1435
1436 ALTER TABLE ONLY filter ALTER COLUMN id SET DEFAULT nextval('filter_id_seq'::regclass);
1437
1438
1439 --
1440 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1441 --
1442
1443 ALTER TABLE ONLY filter_value ALTER COLUMN id SET DEFAULT nextval('filter_value_id_seq'::regclass);
1444
1445
1446 --
1447 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1448 --
1449
1450 ALTER TABLE ONLY koordinaten_art ALTER COLUMN id SET DEFAULT nextval('koordinaten_art_id_seq'::regclass);
1451
1452
1453 --
1454 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1455 --
1456
1457 ALTER TABLE ONLY lada_user ALTER COLUMN id SET DEFAULT nextval('lada_user_id_seq'::regclass);
1458
1459
1460 --
1461 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1462 --
1463
1464 ALTER TABLE ONLY mess_einheit ALTER COLUMN id SET DEFAULT nextval('mess_einheit_id_seq'::regclass);
1465
1466
1467 --
1468 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1469 --
1470
1471 ALTER TABLE ONLY messgroesse ALTER COLUMN id SET DEFAULT nextval('messgroesse_id_seq'::regclass);
1472
1473
1474 --
1475 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1476 --
1477
1478 ALTER TABLE ONLY messgroessen_gruppe ALTER COLUMN id SET DEFAULT nextval('messgroessen_gruppe_id_seq'::regclass);
1479
1480
1481 --
1482 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1483 --
1484
1485 ALTER TABLE ONLY messprogramm_kategorie ALTER COLUMN id SET DEFAULT nextval('messprogramm_kategorie_id_seq'::regclass);
1486
1487
1488 --
1489 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1490 --
1491
1492 ALTER TABLE ONLY ort ALTER COLUMN id SET DEFAULT nextval('ort_id_seq'::regclass);
1493
1494
1495 --
1496 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1497 --
1498
1499 ALTER TABLE ONLY pflicht_messgroesse ALTER COLUMN id SET DEFAULT nextval('pflicht_messgroesse_id_seq'::regclass);
1500
1501
1502 --
1503 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1504 --
1505
1506 ALTER TABLE ONLY probenart ALTER COLUMN id SET DEFAULT nextval('probenart_id_seq'::regclass);
1507
1508
1509 --
1510 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1511 --
1512
1513 ALTER TABLE ONLY probenehmer ALTER COLUMN id SET DEFAULT nextval('probenehmer_id_seq'::regclass);
1514
1515
1516 --
1517 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1518 --
1519
1520 ALTER TABLE ONLY query ALTER COLUMN id SET DEFAULT nextval('query_id_seq'::regclass);
1521
1522
1523 --
1524 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1525 --
1526
1527 ALTER TABLE ONLY result ALTER COLUMN id SET DEFAULT nextval('result_id_seq'::regclass);
1528
1529
1530 --
1531 -- Name: id; Type: DEFAULT; Schema: stammdaten; Owner: -
1532 --
1533
1534 ALTER TABLE ONLY staat ALTER COLUMN id SET DEFAULT nextval('staat_id_seq'::regclass);
1535
1536
1537 --
1538 -- Name: auth_lst_umw_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1539 --
1540
1541 ALTER TABLE ONLY auth_lst_umw
1542 ADD CONSTRAINT auth_lst_umw_pkey PRIMARY KEY (id);
1543
1544
1545 --
1546 -- Name: auth_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1547 --
1548
1549 ALTER TABLE ONLY auth
1550 ADD CONSTRAINT auth_pkey PRIMARY KEY (id);
1551
1552
1553 --
1554 -- Name: auth_role_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1555 --
1556
1557 ALTER TABLE ONLY auth_funktion
1558 ADD CONSTRAINT auth_role_pkey PRIMARY KEY (id);
1559
1560
1561 --
1562 -- Name: datenbasis_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1563 --
1564
1565 ALTER TABLE ONLY datenbasis
1566 ADD CONSTRAINT datenbasis_pkey PRIMARY KEY (id);
1567
1568
1569 --
1570 -- Name: datensatz_erzeuger_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1571 --
1572
1573 ALTER TABLE ONLY datensatz_erzeuger
1574 ADD CONSTRAINT datensatz_erzeuger_pkey PRIMARY KEY (id);
1575
1576
1577 --
1578 -- Name: de_vg_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1579 --
1580
1581 ALTER TABLE ONLY de_vg
1582 ADD CONSTRAINT de_vg_pkey PRIMARY KEY (id);
1583
1584
1585 --
1586 -- Name: deskriptor_umwelt_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1587 --
1588
1589 ALTER TABLE ONLY deskriptor_umwelt
1590 ADD CONSTRAINT deskriptor_umwelt_pkey PRIMARY KEY (id);
1591
1592
1593 --
1594 -- Name: favorite_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1595 --
1596
1597 ALTER TABLE ONLY favorite
1598 ADD CONSTRAINT favorite_pkey PRIMARY KEY (id);
1599
1600
1601 --
1602 -- Name: filter_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1603 --
1604
1605 ALTER TABLE ONLY filter
1606 ADD CONSTRAINT filter_pkey PRIMARY KEY (id);
1607
1608
1609 --
1610 -- Name: filter_value_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1611 --
1612
1613 ALTER TABLE ONLY filter_value
1614 ADD CONSTRAINT filter_value_pkey PRIMARY KEY (id);
1615
1616
1617 --
1618 -- Name: koordinaten_art_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1619 --
1620
1621 ALTER TABLE ONLY koordinaten_art
1622 ADD CONSTRAINT koordinaten_art_pkey PRIMARY KEY (id);
1623
1624
1625 --
1626 -- Name: lada_user_name_key; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1627 --
1628
1629 ALTER TABLE ONLY lada_user
1630 ADD CONSTRAINT lada_user_name_key UNIQUE (name);
1631
1632
1633 --
1634 -- Name: lada_user_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1635 --
1636
1637 ALTER TABLE ONLY lada_user
1638 ADD CONSTRAINT lada_user_pkey PRIMARY KEY (id);
1639
1640
1641 --
1642 -- Name: mess_einheit_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1643 --
1644
1645 ALTER TABLE ONLY mess_einheit
1646 ADD CONSTRAINT mess_einheit_pkey PRIMARY KEY (id);
1647
1648
1649 --
1650 -- Name: mess_methode_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1651 --
1652
1653 ALTER TABLE ONLY mess_methode
1654 ADD CONSTRAINT mess_methode_pkey PRIMARY KEY (id);
1655
1656
1657 --
1658 -- Name: mess_stelle_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1659 --
1660
1661 ALTER TABLE ONLY mess_stelle
1662 ADD CONSTRAINT mess_stelle_pkey PRIMARY KEY (id);
1663
1664
1665 --
1666 -- Name: messgroesse_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1667 --
1668
1669 ALTER TABLE ONLY messgroesse
1670 ADD CONSTRAINT messgroesse_pkey PRIMARY KEY (id);
1671
1672
1673 --
1674 -- Name: messgroessen_gruppe_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1675 --
1676
1677 ALTER TABLE ONLY messgroessen_gruppe
1678 ADD CONSTRAINT messgroessen_gruppe_pkey PRIMARY KEY (id);
1679
1680
1681 --
1682 -- Name: messprogramm_kategorie_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1683 --
1684
1685 ALTER TABLE ONLY messprogramm_kategorie
1686 ADD CONSTRAINT messprogramm_kategorie_pkey PRIMARY KEY (id);
1687
1688
1689 --
1690 -- Name: mg_grp_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1691 --
1692
1693 ALTER TABLE ONLY mg_grp
1694 ADD CONSTRAINT mg_grp_pkey PRIMARY KEY (messgroessengruppe_id, messgroesse_id);
1695
1696
1697 --
1698 -- Name: mmt_messgroesse_grp_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1699 --
1700
1701 ALTER TABLE ONLY mmt_messgroesse_grp
1702 ADD CONSTRAINT mmt_messgroesse_grp_pkey PRIMARY KEY (messgroessengruppe_id, mmt_id);
1703
1704
1705 --
1706 -- Name: netz_betreiber_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1707 --
1708
1709 ALTER TABLE ONLY netz_betreiber
1710 ADD CONSTRAINT netz_betreiber_pkey PRIMARY KEY (id);
1711
1712
1713 --
1714 -- Name: ort_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1715 --
1716
1717 ALTER TABLE ONLY ort
1718 ADD CONSTRAINT ort_pkey PRIMARY KEY (id);
1719
1720
1721 --
1722 -- Name: ort_typ_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1723 --
1724
1725 ALTER TABLE ONLY ort_typ
1726 ADD CONSTRAINT ort_typ_pkey PRIMARY KEY (id);
1727
1728
1729 --
1730 -- Name: ortszuordnung_typ_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1731 --
1732
1733 ALTER TABLE ONLY ortszuordnung_typ
1734 ADD CONSTRAINT ortszuordnung_typ_pkey PRIMARY KEY (id);
1735
1736
1737 --
1738 -- Name: pflicht_messgroesse_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1739 --
1740
1741 ALTER TABLE ONLY pflicht_messgroesse
1742 ADD CONSTRAINT pflicht_messgroesse_pkey PRIMARY KEY (id);
1743
1744
1745 --
1746 -- Name: pk_deskriptoren; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1747 --
1748
1749 ALTER TABLE ONLY deskriptoren
1750 ADD CONSTRAINT pk_deskriptoren PRIMARY KEY (id);
1751
1752
1753 --
1754 -- Name: proben_zusatz_eudf_keyword_key; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1755 --
1756
1757 ALTER TABLE ONLY proben_zusatz
1758 ADD CONSTRAINT proben_zusatz_eudf_keyword_key UNIQUE (eudf_keyword);
1759
1760
1761 --
1762 -- Name: proben_zusatz_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1763 --
1764
1765 ALTER TABLE ONLY proben_zusatz
1766 ADD CONSTRAINT proben_zusatz_pkey PRIMARY KEY (id);
1767
1768
1769 --
1770 -- Name: probenart_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1771 --
1772
1773 ALTER TABLE ONLY probenart
1774 ADD CONSTRAINT probenart_pkey PRIMARY KEY (id);
1775
1776
1777 --
1778 -- Name: probenehmer_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1779 --
1780
1781 ALTER TABLE ONLY probenehmer
1782 ADD CONSTRAINT probenehmer_pkey PRIMARY KEY (id);
1783
1784
1785 --
1786 -- Name: query_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1787 --
1788
1789 ALTER TABLE ONLY query
1790 ADD CONSTRAINT query_pkey PRIMARY KEY (id);
1791
1792
1793 --
1794 -- Name: result_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1795 --
1796
1797 ALTER TABLE ONLY result
1798 ADD CONSTRAINT result_pkey PRIMARY KEY (id);
1799
1800
1801 --
1802 -- Name: staat_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1803 --
1804
1805 ALTER TABLE ONLY staat
1806 ADD CONSTRAINT staat_pkey PRIMARY KEY (id);
1807
1808
1809 --
1810 -- Name: status_kombi_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1811 --
1812
1813 ALTER TABLE ONLY status_kombi
1814 ADD CONSTRAINT status_kombi_pkey PRIMARY KEY (id);
1815
1816
1817 --
1818 -- Name: status_reihenfolge_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1819 --
1820
1821 ALTER TABLE ONLY status_reihenfolge
1822 ADD CONSTRAINT status_reihenfolge_pkey PRIMARY KEY (id);
1823
1824
1825 --
1826 -- Name: status_stufe_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1827 --
1828
1829 ALTER TABLE ONLY status_stufe
1830 ADD CONSTRAINT status_stufe_pkey PRIMARY KEY (id);
1831
1832
1833 --
1834 -- Name: status_wert_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1835 --
1836
1837 ALTER TABLE ONLY status_wert
1838 ADD CONSTRAINT status_wert_pkey PRIMARY KEY (id);
1839
1840
1841 --
1842 -- Name: umwelt_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1843 --
1844
1845 ALTER TABLE ONLY umwelt
1846 ADD CONSTRAINT umwelt_pkey PRIMARY KEY (id);
1847
1848
1849 --
1850 -- Name: umwelt_umwelt_bereich_key; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1851 --
1852
1853 ALTER TABLE ONLY umwelt
1854 ADD CONSTRAINT umwelt_umwelt_bereich_key UNIQUE (umwelt_bereich);
1855
1856
1857 --
1858 -- Name: verwaltungseinheit_pkey; Type: CONSTRAINT; Schema: stammdaten; Owner: -; Tablespace:
1859 --
1860
1861 ALTER TABLE ONLY verwaltungseinheit
1862 ADD CONSTRAINT verwaltungseinheit_pkey PRIMARY KEY (id);
1863
1864
1865 --
1866 -- Name: de_vg_geom_gist; Type: INDEX; Schema: stammdaten; Owner: -; Tablespace:
1867 --
1868
1869 CREATE INDEX de_vg_geom_gist ON de_vg USING gist (geom);
1870
1871
1872 --
1873 -- Name: fts_stauts_kooin10001; Type: INDEX; Schema: stammdaten; Owner: -; Tablespace:
1874 --
1875
1876 CREATE INDEX fts_stauts_kooin10001 ON staat USING btree (kda_id);
1877
1878
1879 --
1880 -- Name: auth_funktion_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1881 --
1882
1883 ALTER TABLE ONLY auth
1884 ADD CONSTRAINT auth_funktion_fkey FOREIGN KEY (funktion_id) REFERENCES auth_funktion(id);
1885
1886
1887 --
1888 -- Name: auth_labor_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1889 --
1890
1891 ALTER TABLE ONLY auth
1892 ADD CONSTRAINT auth_labor_fkey FOREIGN KEY (labor_mst_id) REFERENCES mess_stelle(id);
1893
1894
1895 --
1896 -- Name: auth_lst_umw_lst_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1897 --
1898
1899 ALTER TABLE ONLY auth_lst_umw
1900 ADD CONSTRAINT auth_lst_umw_lst_fkey FOREIGN KEY (lst_id) REFERENCES mess_stelle(id);
1901
1902
1903 --
1904 -- Name: auth_lst_umw_umw_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1905 --
1906
1907 ALTER TABLE ONLY auth_lst_umw
1908 ADD CONSTRAINT auth_lst_umw_umw_fkey FOREIGN KEY (umw_id) REFERENCES umwelt(id);
1909
1910
1911 --
1912 -- Name: auth_mst_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1913 --
1914
1915 ALTER TABLE ONLY auth
1916 ADD CONSTRAINT auth_mst_id_fkey FOREIGN KEY (mst_id) REFERENCES mess_stelle(id);
1917
1918
1919 --
1920 -- Name: auth_netzbetreiber_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1921 --
1922
1923 ALTER TABLE ONLY auth
1924 ADD CONSTRAINT auth_netzbetreiber_id_fkey FOREIGN KEY (netzbetreiber_id) REFERENCES netz_betreiber(id);
1925
1926
1927 --
1928 -- Name: datensatz_erzeuger_mst_id_fkey1; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1929 --
1930
1931 ALTER TABLE ONLY datensatz_erzeuger
1932 ADD CONSTRAINT datensatz_erzeuger_mst_id_fkey1 FOREIGN KEY (mst_id) REFERENCES mess_stelle(id);
1933
1934
1935 --
1936 -- Name: datensatz_erzeuger_netzbetreiber_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1937 --
1938
1939 ALTER TABLE ONLY datensatz_erzeuger
1940 ADD CONSTRAINT datensatz_erzeuger_netzbetreiber_id_fkey FOREIGN KEY (netzbetreiber_id) REFERENCES netz_betreiber(id);
1941
1942
1943 --
1944 -- Name: favorite_query_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1945 --
1946
1947 ALTER TABLE ONLY favorite
1948 ADD CONSTRAINT favorite_query_id_fkey FOREIGN KEY (query_id) REFERENCES query(id);
1949
1950
1951 --
1952 -- Name: favorite_user_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1953 --
1954
1955 ALTER TABLE ONLY favorite
1956 ADD CONSTRAINT favorite_user_id_fkey FOREIGN KEY (user_id) REFERENCES lada_user(id);
1957
1958
1959 --
1960 -- Name: filter_query_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1961 --
1962
1963 ALTER TABLE ONLY filter
1964 ADD CONSTRAINT filter_query_id_fkey FOREIGN KEY (query_id) REFERENCES query(id);
1965
1966
1967 --
1968 -- Name: filter_value_filter_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1969 --
1970
1971 ALTER TABLE ONLY filter_value
1972 ADD CONSTRAINT filter_value_filter_id_fkey FOREIGN KEY (filter_id) REFERENCES filter(id);
1973
1974
1975 --
1976 -- Name: filter_value_query_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1977 --
1978
1979 ALTER TABLE ONLY filter_value
1980 ADD CONSTRAINT filter_value_query_id_fkey FOREIGN KEY (query_id) REFERENCES query(id);
1981
1982
1983 --
1984 -- Name: filter_value_user_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1985 --
1986
1987 ALTER TABLE ONLY filter_value
1988 ADD CONSTRAINT filter_value_user_id_fkey FOREIGN KEY (user_id) REFERENCES lada_user(id);
1989
1990
1991 --
1992 -- Name: fk_deskriptoren_vorgaenger; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
1993 --
1994
1995 ALTER TABLE ONLY deskriptoren
1996 ADD CONSTRAINT fk_deskriptoren_vorgaenger FOREIGN KEY (vorgaenger) REFERENCES deskriptoren(id);
1997
1998
1999 --
2000 -- Name: messprogramm_kategorie_netzbetreiber_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2001 --
2002
2003 ALTER TABLE ONLY messprogramm_kategorie
2004 ADD CONSTRAINT messprogramm_kategorie_netzbetreiber_id_fkey FOREIGN KEY (netzbetreiber_id) REFERENCES netz_betreiber(id);
2005
2006
2007 --
2008 -- Name: ort_anlage_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2009 --
2010
2011 ALTER TABLE ONLY ort
2012 ADD CONSTRAINT ort_anlage_fkey FOREIGN KEY (anlage_id) REFERENCES ort(id);
2013
2014
2015 --
2016 -- Name: ort_gem_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2017 --
2018
2019 ALTER TABLE ONLY ort
2020 ADD CONSTRAINT ort_gem_id_fkey FOREIGN KEY (gem_id) REFERENCES verwaltungseinheit(id);
2021
2022
2023 --
2024 -- Name: ort_kda_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2025 --
2026
2027 ALTER TABLE ONLY ort
2028 ADD CONSTRAINT ort_kda_id_fkey FOREIGN KEY (kda_id) REFERENCES koordinaten_art(id);
2029
2030
2031 --
2032 -- Name: ort_netzbetreiber_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2033 --
2034
2035 ALTER TABLE ONLY ort
2036 ADD CONSTRAINT ort_netzbetreiber_id_fkey FOREIGN KEY (netzbetreiber_id) REFERENCES netz_betreiber(id);
2037
2038
2039 --
2040 -- Name: ort_ort_typ_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2041 --
2042
2043 ALTER TABLE ONLY ort
2044 ADD CONSTRAINT ort_ort_typ_fkey FOREIGN KEY (ort_typ) REFERENCES ort_typ(id);
2045
2046
2047 --
2048 -- Name: ort_oz_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2049 --
2050
2051 ALTER TABLE ONLY ort
2052 ADD CONSTRAINT ort_oz_fkey FOREIGN KEY (oz_id) REFERENCES ort(id);
2053
2054
2055 --
2056 -- Name: ort_staat_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2057 --
2058
2059 ALTER TABLE ONLY ort
2060 ADD CONSTRAINT ort_staat_id_fkey FOREIGN KEY (staat_id) REFERENCES staat(id);
2061
2062
2063 --
2064 -- Name: pflicht_messgroesse_datenbasis_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2065 --
2066
2067 ALTER TABLE ONLY pflicht_messgroesse
2068 ADD CONSTRAINT pflicht_messgroesse_datenbasis_id_fkey FOREIGN KEY (datenbasis_id) REFERENCES datenbasis(id);
2069
2070
2071 --
2072 -- Name: pflicht_messgroesse_mmt_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2073 --
2074
2075 ALTER TABLE ONLY pflicht_messgroesse
2076 ADD CONSTRAINT pflicht_messgroesse_mmt_id_fkey FOREIGN KEY (mmt_id) REFERENCES mess_methode(id);
2077
2078
2079 --
2080 -- Name: pflicht_messgroesse_umw_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2081 --
2082
2083 ALTER TABLE ONLY pflicht_messgroesse
2084 ADD CONSTRAINT pflicht_messgroesse_umw_id_fkey FOREIGN KEY (umw_id) REFERENCES umwelt(id);
2085
2086
2087 --
2088 -- Name: proben_zusatz_meh_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2089 --
2090
2091 ALTER TABLE ONLY proben_zusatz
2092 ADD CONSTRAINT proben_zusatz_meh_id_fkey FOREIGN KEY (meh_id) REFERENCES mess_einheit(id);
2093
2094
2095 --
2096 -- Name: probenehmer_netzbetreiber_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2097 --
2098
2099 ALTER TABLE ONLY probenehmer
2100 ADD CONSTRAINT probenehmer_netzbetreiber_id_fkey FOREIGN KEY (netzbetreiber_id) REFERENCES netz_betreiber(id);
2101
2102
2103 --
2104 -- Name: result_query_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2105 --
2106
2107 ALTER TABLE ONLY result
2108 ADD CONSTRAINT result_query_id_fkey FOREIGN KEY (query_id) REFERENCES query(id);
2109
2110
2111 --
2112 -- Name: staat_kda_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2113 --
2114
2115 ALTER TABLE ONLY staat
2116 ADD CONSTRAINT staat_kda_id_fkey FOREIGN KEY (kda_id) REFERENCES koordinaten_art(id);
2117
2118
2119 --
2120 -- Name: status_kombi_stufe_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2121 --
2122
2123 ALTER TABLE ONLY status_kombi
2124 ADD CONSTRAINT status_kombi_stufe_id_fkey FOREIGN KEY (stufe_id) REFERENCES status_stufe(id);
2125
2126
2127 --
2128 -- Name: status_kombi_wert_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2129 --
2130
2131 ALTER TABLE ONLY status_kombi
2132 ADD CONSTRAINT status_kombi_wert_id_fkey FOREIGN KEY (wert_id) REFERENCES status_wert(id);
2133
2134
2135 --
2136 -- Name: status_reihenfolge_von_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2137 --
2138
2139 ALTER TABLE ONLY status_reihenfolge
2140 ADD CONSTRAINT status_reihenfolge_von_id_fkey FOREIGN KEY (von_id) REFERENCES status_kombi(id);
2141
2142
2143 --
2144 -- Name: status_reihenfolge_zu_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2145 --
2146
2147 ALTER TABLE ONLY status_reihenfolge
2148 ADD CONSTRAINT status_reihenfolge_zu_id_fkey FOREIGN KEY (zu_id) REFERENCES status_kombi(id);
2149
2150
2151 --
2152 -- Name: umwelt_meh_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2153 --
2154
2155 ALTER TABLE ONLY umwelt
2156 ADD CONSTRAINT umwelt_meh_id_fkey FOREIGN KEY (meh_id) REFERENCES mess_einheit(id);
2157
2158
2159 --
2160 -- Name: verwaltungseinheit_kda_id_fkey; Type: FK CONSTRAINT; Schema: stammdaten; Owner: -
2161 --
2162
2163 ALTER TABLE ONLY verwaltungseinheit
2164 ADD CONSTRAINT verwaltungseinheit_kda_id_fkey FOREIGN KEY (kda_id) REFERENCES koordinaten_art(id);
2165
2166
2167 COMMIT;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)