From 07353bba219306db01bee28a33670e8296f2f1f2 Mon Sep 17 00:00:00 2001 From: akrherz Date: Sat, 30 Apr 2022 15:00:07 -0500 Subject: [PATCH] add watch probability storage refs akrherz/pyIEM#595 --- init/postgis.sql | 20 ++++++++++++++++++-- upgrade/postgis/60.sql | 17 +++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 upgrade/postgis/60.sql diff --git a/init/postgis.sql b/init/postgis.sql index deb2185..70e8759 100644 --- a/init/postgis.sql +++ b/init/postgis.sql @@ -5,7 +5,7 @@ CREATE EXTENSION postgis; CREATE TABLE iem_schema_manager_version( version int, updated timestamptz); -INSERT into iem_schema_manager_version values (59, now()); +INSERT into iem_schema_manager_version values (60, now()); --- --- TABLES THAT ARE LOADED VIA shp2pgsql @@ -1073,7 +1073,23 @@ CREATE TABLE watches ( type character(3), report text, num smallint, - geom geometry(MultiPolygon, 4326) + geom geometry(MultiPolygon, 4326), + tornadoes_2m smallint, + tornadoes_1m_strong smallint, + wind_10m smallint, + wind_1m_65kt smallint, + hail_10m smallint, + hail_1m_2inch smallint, + hail_wind_6m smallint, + max_hail_size float, + max_wind_gust_knots float, + max_tops_feet int, + storm_motion_drct int, + storm_motion_sknt int, + is_pds bool, + product_id_wwp varchar(36), + product_id_saw varchar(36), + product_id_wou varchar(36) ); ALTER TABLE watches OWNER to mesonet; GRANT ALL on watches to ldm; diff --git a/upgrade/postgis/60.sql b/upgrade/postgis/60.sql new file mode 100644 index 0000000..048f43c --- /dev/null +++ b/upgrade/postgis/60.sql @@ -0,0 +1,17 @@ +-- Storage of Watch Probabilites +ALTER TABLE watches add tornadoes_2m smallint; +ALTER TABLE watches add tornadoes_1m_strong smallint; +ALTER TABLE watches add wind_10m smallint; +ALTER TABLE watches add wind_1m_65kt smallint; +ALTER TABLE watches add hail_10m smallint; +ALTER TABLE watches add hail_1m_2inch smallint; +ALTER TABLE watches add hail_wind_6m smallint; +ALTER TABLE watches add max_hail_size float; +ALTER TABLE watches add max_wind_gust_knots float; +ALTER TABLE watches add max_tops_feet int; +ALTER TABLE watches add storm_motion_drct int; +ALTER TABLE watches add storm_motion_sknt int; +ALTER TABLE watches add is_pds bool; +ALTER TABLE watches add product_id_wwp varchar(36); +ALTER TABLE watches add product_id_saw varchar(36); +ALTER TABLE watches add product_id_wou varchar(36);