Skip to content

Commit

Permalink
Merge pull request #687 from NOAA-OWP/shawncrawley-patch-1
Browse files Browse the repository at this point in the history
Refs #686
Though this change was applied manually in terms of the hotfix, this commit applies the update SQL to the core repository in the spot where the modified table is originally created. Thus, this change should hopefully not fall through the cracks and be reverted in the future.
  • Loading branch information
nickchadwick-noaa authored Apr 19, 2024
2 parents 0cc9b78 + fee5c7f commit 921c4b9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ LEFT JOIN a AS b
ON b.location_id = a.location_id
AND b.row_num = a.row_num + 1;

-- CREATE VIZ-OFFICIAL CROSSWALK TABLE
-- CREATE VIZ-OFFICIAL CROSSWALK TABLE AND ADD OVERRIDES
SELECT DISTINCT ON (nwm_feature_id, nws_station_id)
*
INTO rnr.nwm_crosswalk
Expand All @@ -114,6 +114,10 @@ ORDER BY
nws_usgs_crosswalk_dataset_id DESC NULLS LAST,
location_nwm_crosswalk_dataset_id DESC NULLS LAST;

UPDATE rnr.nwm_crosswalk
SET nwm_feature_id = 11050844
WHERE nws_station_id = 'PTTP1';

-- CREATE FLOW_THRESHOLDS VIEW
-- Officially in Core\EC2\RDSBastion\scripts\utils\setup_foreign_tables.tftpl (for automatic execution on deployment), but duplicated here for reference
DROP VIEW IF EXISTS rnr.flow_thresholds;
Expand Down Expand Up @@ -217,4 +221,4 @@ SELECT
'Native' as record_source
FROM external.threshold station
WHERE rating_source = 'NONE'
AND COALESCE(action_stage, minor_stage, moderate_stage, major_stage, record_stage) IS NOT NULL;
AND COALESCE(action_stage, minor_stage, moderate_stage, major_stage, record_stage) IS NOT NULL;

0 comments on commit 921c4b9

Please sign in to comment.