comparison db_schema/stammdaten_schema.sql @ 905:df2908334150

Set netzbetreiber-specific IDs UNIQUE per netzbetreiber.
author Tom Gottfried <tom@intevation.de>
date Tue, 05 Apr 2016 10:49:13 +0200
parents 825d82b8ad6e
children d8c66007fa14
comparison
equal deleted inserted replaced
904:825d82b8ad6e 905:df2908334150
214 DEFAULT nextval('datensatz_erzeuger_id_seq'::regclass), 214 DEFAULT nextval('datensatz_erzeuger_id_seq'::regclass),
215 netzbetreiber_id character varying(2) NOT NULL REFERENCES netz_betreiber, 215 netzbetreiber_id character varying(2) NOT NULL REFERENCES netz_betreiber,
216 da_erzeuger_id character varying(2) NOT NULL, 216 da_erzeuger_id character varying(2) NOT NULL,
217 mst_id character varying(5) NOT NULL REFERENCES mess_stelle, 217 mst_id character varying(5) NOT NULL REFERENCES mess_stelle,
218 bezeichnung character varying(120) NOT NULL, 218 bezeichnung character varying(120) NOT NULL,
219 letzte_aenderung timestamp without time zone 219 letzte_aenderung timestamp without time zone,
220 UNIQUE(da_erzeuger_id, netzbetreiber_id)
220 ); 221 );
221 222
222 ALTER SEQUENCE datensatz_erzeuger_id_seq OWNED BY datensatz_erzeuger.id; 223 ALTER SEQUENCE datensatz_erzeuger_id_seq OWNED BY datensatz_erzeuger.id;
223 224
224 225
448 id integer PRIMARY KEY 449 id integer PRIMARY KEY
449 DEFAULT nextval('messprogramm_kategorie_id_seq'::regclass), 450 DEFAULT nextval('messprogramm_kategorie_id_seq'::regclass),
450 netzbetreiber_id character varying(2) NOT NULL REFERENCES netz_betreiber, 451 netzbetreiber_id character varying(2) NOT NULL REFERENCES netz_betreiber,
451 mpl_id character varying(3) NOT NULL, 452 mpl_id character varying(3) NOT NULL,
452 bezeichnung character varying(120) NOT NULL, 453 bezeichnung character varying(120) NOT NULL,
453 letzte_aenderung timestamp without time zone 454 letzte_aenderung timestamp without time zone,
455 UNIQUE(mpl_id, netzbetreiber_id)
454 ); 456 );
455 457
456 ALTER SEQUENCE messprogramm_kategorie_id_seq 458 ALTER SEQUENCE messprogramm_kategorie_id_seq
457 OWNED BY messprogramm_kategorie.id; 459 OWNED BY messprogramm_kategorie.id;
458 460
515 sektor character varying(2), 517 sektor character varying(2),
516 zustaendigkeit character varying(10), 518 zustaendigkeit character varying(10),
517 mp_art character varying(10), 519 mp_art character varying(10),
518 aktiv character(1), 520 aktiv character(1),
519 anlage_id integer, 521 anlage_id integer,
520 oz_id integer 522 oz_id integer,
523 UNIQUE(ort_id, netzbetreiber_id)
521 ); 524 );
522 525
523 ALTER TABLE ONLY ort 526 ALTER TABLE ONLY ort
524 ADD CONSTRAINT ort_anlage_fkey FOREIGN KEY (anlage_id) REFERENCES ort(id); 527 ADD CONSTRAINT ort_anlage_fkey FOREIGN KEY (anlage_id) REFERENCES ort(id);
525 528
600 plz character varying(5), 603 plz character varying(5),
601 strasse character varying(30), 604 strasse character varying(30),
602 telefon character varying(20), 605 telefon character varying(20),
603 tp character varying(3), 606 tp character varying(3),
604 typ character(1), 607 typ character(1),
605 letzte_aenderung timestamp without time zone 608 letzte_aenderung timestamp without time zone,
609 UNIQUE(prn_id, netzbetreiber_id)
606 ); 610 );
607 611
608 ALTER SEQUENCE probenehmer_id_seq OWNED BY probenehmer.id; 612 ALTER SEQUENCE probenehmer_id_seq OWNED BY probenehmer.id;
609 613
610 614
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)