# HG changeset patch # User Tom Gottfried # Date 1559148095 -7200 # Node ID 337e9f85f84caa2c99410e559eca7bff814d0b1f # Parent 8e083b271fca91a9e706f990bf2ee07acabbe756 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. diff -r 8e083b271fca -r 337e9f85f84c schema/gemma.sql --- a/schema/gemma.sql Wed May 29 18:14:20 2019 +0200 +++ b/schema/gemma.sql Wed May 29 18:41:35 2019 +0200 @@ -288,6 +288,7 @@ lastupdate timestamp with time zone NOT NULL, -- entry removed from external data source (RIS-Index)/historicised: erased boolean NOT NULL DEFAULT false, + CHECK (erased OR NOT isempty(validity)), PRIMARY KEY (location, validity), EXCLUDE USING GiST (isrs_astext(location) WITH =, validity WITH &&) DEFERRABLE INITIALLY DEFERRED