comparison schema/gemma.sql @ 3278:831193935739

Avoid storing of NtS messages other than water level
author Tom Gottfried <tom@intevation.de>
date Wed, 15 May 2019 19:42:21 +0200
parents 232fc90e6ee2
children ec6163c6687d
comparison
equal deleted inserted replaced
3277:232fc90e6ee2 3278:831193935739
309 sender varchar NOT NULL, -- "from" element from NtS response 309 sender varchar NOT NULL, -- "from" element from NtS response
310 language_code varchar NOT NULL REFERENCES language_codes, 310 language_code varchar NOT NULL REFERENCES language_codes,
311 date_issue timestamp with time zone NOT NULL, 311 date_issue timestamp with time zone NOT NULL,
312 reference_code varchar(4) NOT NULL REFERENCES depth_references, 312 reference_code varchar(4) NOT NULL REFERENCES depth_references,
313 water_level double precision NOT NULL, 313 water_level double precision NOT NULL,
314 is_waterlevel boolean NOT NULL,
315 date_info timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, 314 date_info timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
316 source_organization varchar NOT NULL, -- "originator" from NtS response 315 source_organization varchar NOT NULL, -- "originator" from NtS response
317 staging_done boolean NOT NULL DEFAULT false, 316 staging_done boolean NOT NULL DEFAULT false,
318 UNIQUE (fk_gauge_id, measure_date, staging_done) 317 UNIQUE (fk_gauge_id, measure_date, staging_done)
319 ) 318 )
325 sender varchar NOT NULL, -- "from" element from NtS response 324 sender varchar NOT NULL, -- "from" element from NtS response
326 language_code varchar NOT NULL REFERENCES language_codes, 325 language_code varchar NOT NULL REFERENCES language_codes,
327 date_issue timestamp with time zone NOT NULL, 326 date_issue timestamp with time zone NOT NULL,
328 reference_code varchar(4) NOT NULL REFERENCES depth_references, 327 reference_code varchar(4) NOT NULL REFERENCES depth_references,
329 water_level double precision NOT NULL, 328 water_level double precision NOT NULL,
330 is_waterlevel boolean NOT NULL,
331 conf_interval numrange 329 conf_interval numrange
332 CHECK (conf_interval @> CAST(water_level AS numeric)), 330 CHECK (conf_interval @> CAST(water_level AS numeric)),
333 date_info timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, 331 date_info timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
334 source_organization varchar NOT NULL, -- "originator" from NtS response 332 source_organization varchar NOT NULL, -- "originator" from NtS response
335 PRIMARY KEY (fk_gauge_id, measure_date, date_issue) 333 PRIMARY KEY (fk_gauge_id, measure_date, date_issue)