comparison schema/gemma.sql @ 3529:ba0339118d9c

Improve validation of gauge temporal validity The current version of a gauge should always have a validity represented by a non-empty time range. Thus, do not accept empty time ranges on input. Nevertheless, continue to accept storing empty time ranges (no CHECK constraint), because a new version with equal start date but longer validity might still cause the previous version to get an empty time range. In passing, add a missing NOT NULL constraint: if both start and end date are omitted, the range will be unbounded, but it should never be NULL.
author Tom Gottfried <tom@intevation.de>
date Wed, 29 May 2019 16:43:26 +0200
parents 6592396f5061
children 8e083b271fca
comparison
equal deleted inserted replaced
3528:b9e331c1e616 3529:ba0339118d9c
278 AND CAST(substring((location).orc from 2 for 4) AS int) < 2048), 278 AND CAST(substring((location).orc from 2 for 4) AS int) < 2048),
279 objname varchar NOT NULL, 279 objname varchar NOT NULL,
280 geom geography(POINT, 4326) NOT NULL, 280 geom geography(POINT, 4326) NOT NULL,
281 applicability_from_km int8, 281 applicability_from_km int8,
282 applicability_to_km int8, 282 applicability_to_km int8,
283 validity tstzrange, 283 validity tstzrange NOT NULL,
284 zero_point double precision NOT NULL, 284 zero_point double precision NOT NULL,
285 geodref varchar, 285 geodref varchar,
286 date_info timestamp with time zone NOT NULL, 286 date_info timestamp with time zone NOT NULL,
287 source_organization varchar, 287 source_organization varchar,
288 lastupdate timestamp with time zone NOT NULL, 288 lastupdate timestamp with time zone NOT NULL,