comparison schema/gemma.sql @ 3423:6592396f5061

Make revisiting time of a bottleneck optional
author Tom Gottfried <tom@intevation.de>
date Thu, 23 May 2019 15:33:56 +0200
parents c04b1409a596
children ba0339118d9c
comparison
equal deleted inserted replaced
3422:34e846f89936 3423:6592396f5061
483 FOR EACH ROW EXECUTE PROCEDURE update_date_info() 483 FOR EACH ROW EXECUTE PROCEDURE update_date_info()
484 484
485 -- 485 --
486 -- Bottlenecks 486 -- Bottlenecks
487 -- 487 --
488 -- XXX: Nullability differs between DRC (attributes marked "O") and WSDL
489 -- (minOccurs=0; nillable seems to be set arbitrarily as even bottleneck_id and
490 -- fk_g_fid (both mandatory, i.e. marked "M" in DRC) have nillable="true" in WSDL)
491 CREATE TABLE bottlenecks ( 488 CREATE TABLE bottlenecks (
492 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 489 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
493 bottleneck_id varchar UNIQUE NOT NULL, 490 bottleneck_id varchar UNIQUE NOT NULL,
494 gauge_location isrs NOT NULL, 491 gauge_location isrs NOT NULL,
495 gauge_validity tstzrange NOT NULL, 492 gauge_validity tstzrange NOT NULL,
502 area geography(MULTIPOLYGON, 4326) NOT NULL 499 area geography(MULTIPOLYGON, 4326) NOT NULL
503 CHECK(ST_IsValid(CAST(area AS geometry))), 500 CHECK(ST_IsValid(CAST(area AS geometry))),
504 rb char(2) REFERENCES countries, -- from rb_lb in interface 501 rb char(2) REFERENCES countries, -- from rb_lb in interface
505 lb char(2) REFERENCES countries, -- from rb_lb in interface 502 lb char(2) REFERENCES countries, -- from rb_lb in interface
506 responsible_country char(2) NOT NULL REFERENCES countries, 503 responsible_country char(2) NOT NULL REFERENCES countries,
507 revisiting_time smallint NOT NULL, 504 revisiting_time smallint,
508 limiting varchar NOT NULL REFERENCES limiting_factors, 505 limiting varchar NOT NULL REFERENCES limiting_factors,
509 -- surtyp varchar NOT NULL REFERENCES survey_types, 506 -- surtyp varchar NOT NULL REFERENCES survey_types,
510 -- XXX: Also an attribut of sounding result? 507 -- XXX: Also an attribut of sounding result?
511 -- coverage varchar REFERENCES coverage_types, 508 -- coverage varchar REFERENCES coverage_types,
512 -- XXX: Also an attribut of sounding result? 509 -- XXX: Also an attribut of sounding result?