comparison schema/gemma.sql @ 4068:76482935b6e5 historization_ng

Fixed c&p errors in gemma schema. Due to copy and paste from update scripts we hat spurious (wrong!) semicolons and superfluous schema qualifier in the gemma schema.
author Sascha Wilde <wilde@intevation.de>
date Thu, 25 Jul 2019 12:36:07 +0200
parents 0ba3fc89b499
children 4332b9e26e2f
comparison
equal deleted inserted replaced
4067:0ba3fc89b499 4068:76482935b6e5
482 source_organization varchar NOT NULL, -- "originator" from NtS response 482 source_organization varchar NOT NULL, -- "originator" from NtS response
483 staging_done boolean NOT NULL DEFAULT false, 483 staging_done boolean NOT NULL DEFAULT false,
484 UNIQUE (measure_date, location, staging_done) 484 UNIQUE (measure_date, location, staging_done)
485 ) 485 )
486 CREATE CONSTRAINT TRIGGER waterway_gauge_measurements_reference_gauge 486 CREATE CONSTRAINT TRIGGER waterway_gauge_measurements_reference_gauge
487 AFTER INSERT OR UPDATE OF location ON waterway.gauge_measurements 487 AFTER INSERT OR UPDATE OF location ON gauge_measurements
488 FOR EACH ROW EXECUTE FUNCTION check_valid_gauge_ts('location','measure_date'); 488 FOR EACH ROW EXECUTE FUNCTION check_valid_gauge_ts('location','measure_date')
489 -- For fast retrieval of newest measurement per location: 489 -- For fast retrieval of newest measurement per location:
490 CREATE INDEX gauge_measurements_location_measure_date_desc 490 CREATE INDEX gauge_measurements_location_measure_date_desc
491 ON waterway.gauge_measurements (location, measure_date DESC) 491 ON waterway.gauge_measurements (location, measure_date DESC)
492 492
493 CREATE TABLE gauge_predictions ( 493 CREATE TABLE gauge_predictions (
504 date_info timestamp with time zone NOT NULL, 504 date_info timestamp with time zone NOT NULL,
505 source_organization varchar NOT NULL, -- "originator" from NtS response 505 source_organization varchar NOT NULL, -- "originator" from NtS response
506 PRIMARY KEY (measure_date, location, date_issue) 506 PRIMARY KEY (measure_date, location, date_issue)
507 ) 507 )
508 CREATE CONSTRAINT TRIGGER waterway_gauge_predictions_reference_gauge 508 CREATE CONSTRAINT TRIGGER waterway_gauge_predictions_reference_gauge
509 AFTER INSERT OR UPDATE OF location ON waterway.gauge_predictions 509 AFTER INSERT OR UPDATE OF location ON gauge_predictions
510 FOR EACH ROW EXECUTE FUNCTION check_valid_gauge_ts('location','measure_date'); 510 FOR EACH ROW EXECUTE FUNCTION check_valid_gauge_ts('location','measure_date')
511 511
512 CREATE TABLE waterway_axis ( 512 CREATE TABLE waterway_axis (
513 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, 513 id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
514 wtwaxs geography(LINESTRING, 4326) NOT NULL 514 wtwaxs geography(LINESTRING, 4326) NOT NULL
515 CHECK(ST_IsSimple(CAST(wtwaxs AS geometry))), 515 CHECK(ST_IsSimple(CAST(wtwaxs AS geometry))),
700 octree_checksum varchar, 700 octree_checksum varchar,
701 octree_index bytea, 701 octree_index bytea,
702 staging_done boolean NOT NULL DEFAULT false 702 staging_done boolean NOT NULL DEFAULT false
703 ) 703 )
704 CREATE CONSTRAINT TRIGGER a_sounding_results_reference_bottleneck 704 CREATE CONSTRAINT TRIGGER a_sounding_results_reference_bottleneck
705 AFTER INSERT OR UPDATE OF bottleneck_id ON waterway.sounding_results 705 AFTER INSERT OR UPDATE OF bottleneck_id ON sounding_results
706 FOR EACH ROW 706 FOR EACH ROW
707 EXECUTE FUNCTION check_valid_bottleneck_ts('bottleneck_id','date_info'); 707 EXECUTE FUNCTION check_valid_bottleneck_ts('bottleneck_id','date_info')
708 CREATE CONSTRAINT TRIGGER b_sounding_results_in_bn_area 708 CREATE CONSTRAINT TRIGGER b_sounding_results_in_bn_area
709 AFTER INSERT OR UPDATE ON waterway.sounding_results 709 AFTER INSERT OR UPDATE ON sounding_results
710 FOR EACH ROW EXECUTE FUNCTION check_sr_in_bn_area(); 710 FOR EACH ROW EXECUTE FUNCTION check_sr_in_bn_area()
711 711
712 CREATE TABLE sounding_results_contour_lines ( 712 CREATE TABLE sounding_results_contour_lines (
713 sounding_result_id int NOT NULL REFERENCES sounding_results 713 sounding_result_id int NOT NULL REFERENCES sounding_results
714 ON DELETE CASCADE, 714 ON DELETE CASCADE,
715 height numeric NOT NULL, 715 height numeric NOT NULL,