Mercurial > gemma
comparison schema/gemma.sql @ 3535:337e9f85f84c
Prevent non-erased gauge version to have empty validity range
This is a follow-up to revision ba0339118d9c, that did not introduce
such constraint by virtue of missing that we have the information
which gauge is 'current' readily at hand in the erased flag.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 29 May 2019 18:41:35 +0200 |
parents | 8e083b271fca |
children | 3012d0b3badc |
comparison
equal
deleted
inserted
replaced
3533:8e083b271fca | 3535:337e9f85f84c |
---|---|
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, |
289 -- entry removed from external data source (RIS-Index)/historicised: | 289 -- entry removed from external data source (RIS-Index)/historicised: |
290 erased boolean NOT NULL DEFAULT false, | 290 erased boolean NOT NULL DEFAULT false, |
291 CHECK (erased OR NOT isempty(validity)), | |
291 PRIMARY KEY (location, validity), | 292 PRIMARY KEY (location, validity), |
292 EXCLUDE USING GiST (isrs_astext(location) WITH =, validity WITH &&) | 293 EXCLUDE USING GiST (isrs_astext(location) WITH =, validity WITH &&) |
293 DEFERRABLE INITIALLY DEFERRED | 294 DEFERRABLE INITIALLY DEFERRED |
294 ) | 295 ) |
295 -- Allow only one non-erased entry per location | 296 -- Allow only one non-erased entry per location |