comparison db_schema/lada_schema.sql @ 1063:7788a805a98d

Complement data model and validation of sub-intervalls.
author Tom Gottfried <tom@intevation.de>
date Tue, 27 Sep 2016 16:16:31 +0200
parents a435b9fd1d85
children 7d87ddba5520
comparison
equal deleted inserted replaced
1062:0fbcaefc565b 1063:7788a805a98d
586 gueltig_von integer NOT NULL CHECK(gueltig_von BETWEEN 0 AND 364), 586 gueltig_von integer NOT NULL CHECK(gueltig_von BETWEEN 0 AND 364),
587 gueltig_bis integer NOT NULL CHECK(gueltig_bis BETWEEN 0 AND 364), 587 gueltig_bis integer NOT NULL CHECK(gueltig_bis BETWEEN 0 AND 364),
588 probe_nehmer_id integer, 588 probe_nehmer_id integer,
589 probe_kommentar character varying(80), 589 probe_kommentar character varying(80),
590 letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL, 590 letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL,
591 CHECK (probenintervall = 'J'
592 AND teilintervall_von BETWEEN 1 AND 365
593 AND teilintervall_bis BETWEEN 1 AND 365
594 AND intervall_offset BETWEEN 0 AND 364
595 OR probenintervall = 'H'
596 AND teilintervall_von BETWEEN 1 AND 183
597 AND teilintervall_bis BETWEEN 1 AND 183
598 AND intervall_offset BETWEEN 0 AND 182
599 OR probenintervall = 'Q'
600 AND teilintervall_von BETWEEN 1 AND 91
601 AND teilintervall_bis BETWEEN 1 AND 91
602 AND intervall_offset BETWEEN 0 AND 90
603 OR probenintervall = 'M'
604 AND teilintervall_von BETWEEN 1 AND 31
605 AND teilintervall_bis BETWEEN 1 AND 31
606 AND intervall_offset BETWEEN 0 AND 30
607 OR probenintervall = 'W4'
608 AND teilintervall_von BETWEEN 1 AND 28
609 AND teilintervall_bis BETWEEN 1 AND 28
610 AND intervall_offset BETWEEN 0 AND 27
611 OR probenintervall = 'W2'
612 AND teilintervall_von BETWEEN 1 AND 14
613 AND teilintervall_bis BETWEEN 1 AND 14
614 AND intervall_offset BETWEEN 0 AND 13
615 OR probenintervall = 'W'
616 AND teilintervall_von BETWEEN 1 AND 7
617 AND teilintervall_bis BETWEEN 1 AND 7
618 AND intervall_offset BETWEEN 0 AND 6
619 OR probenintervall = 'T'
620 AND teilintervall_von = 1
621 AND teilintervall_bis = 1
622 AND intervall_offset = 0
623 ),
591 CHECK (teilintervall_von <= teilintervall_bis) 624 CHECK (teilintervall_von <= teilintervall_bis)
592 ); 625 );
593 CREATE TRIGGER letzte_aenderung_messprogramm BEFORE UPDATE ON messprogramm FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung(); 626 CREATE TRIGGER letzte_aenderung_messprogramm BEFORE UPDATE ON messprogramm FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
594 627
595 -- 628 --
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)