diff db_schema/lada_schema.sql @ 1044:a796e68da1cf

A period with end before start is not meaningful.
author Tom Gottfried <tom@intevation.de>
date Wed, 07 Sep 2016 18:17:48 +0200
parents e192feaf916f
children 61b94641cf99
line wrap: on
line diff
--- a/db_schema/lada_schema.sql	Tue Jul 05 18:24:55 2016 +0200
+++ b/db_schema/lada_schema.sql	Wed Sep 07 18:17:48 2016 +0200
@@ -587,7 +587,8 @@
     gueltig_bis integer NOT NULL,
     probe_nehmer_id integer,
     probe_kommentar character varying(80),
-    letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL
+    letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL,
+    CHECK (gueltig_von <= gueltig_bis)
 );
 CREATE TRIGGER letzte_aenderung_messprogramm BEFORE UPDATE ON messprogramm FOR EACH ROW EXECUTE PROCEDURE update_letzte_aenderung();
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)