Mercurial > gemma
view schema/updates/1426/01.historicise_axis.sql @ 5132:8d5e3ce27d20
client: Time based search
* Add Time parameter to the search request when Time slider is active
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Fri, 27 Mar 2020 15:30:15 +0100 |
parents | e8661379a6c5 |
children |
line wrap: on
line source
ALTER TABLE waterway.waterway_axis ADD validity tstzrange NOT NULL DEFAULT tstzrange(current_timestamp, NULL) CHECK (NOT isempty(validity)), ADD last_found timestamp with time zone NOT NULL DEFAULT current_timestamp; -- Assume existing entries have been valid since last successful import UPDATE waterway.waterway_axis SET validity = tstzrange( (SELECT max(changed) FROM import.imports WHERE kind = 'wx' AND state = CAST('accepted' AS import_state)), NULL); DROP TRIGGER waterway_axis_wtwaxs_unique ON waterway.waterway_axis; CREATE CONSTRAINT TRIGGER waterway_axis_wtwaxs_unique AFTER INSERT OR UPDATE OF wtwaxs, validity ON waterway.waterway_axis FOR EACH ROW EXECUTE FUNCTION prevent_st_equals('wtwaxs', 'validity'); CREATE INDEX waterway_axis_validity ON waterway.waterway_axis USING GiST (validity); -- No more need to delete DROP POLICY responsibility_area_delete ON waterway.waterway_axis;