-
Notifications
You must be signed in to change notification settings - Fork 3
✨ Add station metadata storage for rwis,other databases #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,55 @@ | ||
| CREATE EXTENSION postgis; | ||
|
|
||
| -- Boilerplate IEM schema_manager_version, the version gets incremented each | ||
| -- time we make an upgrade script | ||
| CREATE TABLE iem_schema_manager_version( | ||
| version int, | ||
| updated timestamptz); | ||
| INSERT into iem_schema_manager_version values (15, now()); | ||
| INSERT into iem_schema_manager_version values (16, now()); | ||
|
|
||
| CREATE TABLE stations( | ||
| id varchar(64), | ||
| synop int, | ||
| name varchar(64), | ||
| state char(2), | ||
| country char(2), | ||
| elevation real, | ||
| network varchar(20), | ||
| online boolean, | ||
| params varchar(300), | ||
| county varchar(50), | ||
| plot_name varchar(64), | ||
| climate_site varchar(6), | ||
| remote_id int, | ||
| nwn_id int, | ||
| spri smallint, | ||
| wfo varchar(3), | ||
| archive_begin date, | ||
| archive_end date, | ||
| modified timestamp with time zone, | ||
| tzname varchar(32), | ||
| iemid SERIAL, | ||
| metasite boolean, | ||
| sigstage_low real, | ||
| sigstage_action real, | ||
| sigstage_bankfull real, | ||
| sigstage_flood real, | ||
| sigstage_moderate real, | ||
| sigstage_major real, | ||
| sigstage_record real, | ||
| ugc_county char(6), | ||
| ugc_zone char(6), | ||
| ncdc81 varchar(11), | ||
| ncei91 varchar(11), | ||
| temp24_hour smallint, | ||
| precip24_hour smallint, | ||
| wigos varchar(64), | ||
| geom geometry(POINT, 4326) | ||
|
Comment on lines
+10
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ); | ||
| alter table stations owner to mesonet; | ||
| grant select on stations to ldm,nobody; | ||
| CREATE UNIQUE index stations_idx on stations(id, network); | ||
| create UNIQUE index stations_iemid_idx on stations(iemid); | ||
|
|
||
| -- Purple Air Data | ||
| create table purpleair( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,55 @@ | ||
| CREATE EXTENSION postgis; | ||
| -- Boilerplate IEM schema_manager_version, the version gets incremented each | ||
| -- time we make an upgrade script | ||
| CREATE TABLE iem_schema_manager_version( | ||
| version int, | ||
| updated timestamptz); | ||
| INSERT into iem_schema_manager_version values (8, now()); | ||
| INSERT into iem_schema_manager_version values (9, now()); | ||
|
|
||
| CREATE TABLE stations( | ||
| id varchar(64), | ||
| synop int, | ||
| name varchar(64), | ||
| state char(2), | ||
| country char(2), | ||
| elevation real, | ||
| network varchar(20), | ||
| online boolean, | ||
| params varchar(300), | ||
| county varchar(50), | ||
| plot_name varchar(64), | ||
| climate_site varchar(6), | ||
| remote_id int, | ||
| nwn_id int, | ||
| spri smallint, | ||
| wfo varchar(3), | ||
| archive_begin date, | ||
| archive_end date, | ||
| modified timestamp with time zone, | ||
| tzname varchar(32), | ||
| iemid SERIAL, | ||
| metasite boolean, | ||
| sigstage_low real, | ||
| sigstage_action real, | ||
| sigstage_bankfull real, | ||
| sigstage_flood real, | ||
| sigstage_moderate real, | ||
| sigstage_major real, | ||
| sigstage_record real, | ||
| ugc_county char(6), | ||
| ugc_zone char(6), | ||
| ncdc81 varchar(11), | ||
| ncei91 varchar(11), | ||
| temp24_hour smallint, | ||
| precip24_hour smallint, | ||
| wigos varchar(64), | ||
| geom geometry(POINT, 4326) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+9
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please suggest how to do this |
||
| ); | ||
| alter table stations owner to mesonet; | ||
| grant select on stations to ldm,nobody; | ||
| CREATE UNIQUE index stations_idx on stations(id, network); | ||
| create UNIQUE index stations_iemid_idx on stations(iemid); | ||
|
|
||
|
|
||
| CREATE TABLE sensors( | ||
| station varchar(5), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| CREATE EXTENSION postgis; | ||
| -- need stations table | ||
| CREATE TABLE stations( | ||
| id varchar(64), | ||
| synop int, | ||
| name varchar(64), | ||
| state char(2), | ||
| country char(2), | ||
| elevation real, | ||
| network varchar(20), | ||
| online boolean, | ||
| params varchar(300), | ||
| county varchar(50), | ||
| plot_name varchar(64), | ||
| climate_site varchar(6), | ||
| remote_id int, | ||
| nwn_id int, | ||
| spri smallint, | ||
| wfo varchar(3), | ||
| archive_begin date, | ||
| archive_end date, | ||
| modified timestamp with time zone, | ||
| tzname varchar(32), | ||
| iemid SERIAL, | ||
| metasite boolean, | ||
| sigstage_low real, | ||
| sigstage_action real, | ||
| sigstage_bankfull real, | ||
| sigstage_flood real, | ||
| sigstage_moderate real, | ||
| sigstage_major real, | ||
| sigstage_record real, | ||
| ugc_county char(6), | ||
| ugc_zone char(6), | ||
| ncdc81 varchar(11), | ||
| ncei91 varchar(11), | ||
| temp24_hour smallint, | ||
| precip24_hour smallint, | ||
| wigos varchar(64), | ||
| geom geometry(POINT, 4326) | ||
akrherz marked this conversation as resolved.
Show resolved
Hide resolved
akrherz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ); | ||
| alter table stations owner to mesonet; | ||
| grant select on stations to ldm,nobody; | ||
| CREATE UNIQUE index stations_idx on stations(id, network); | ||
| create UNIQUE index stations_iemid_idx on stations(iemid); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| CREATE EXTENSION postgis; | ||
| -- need stations table | ||
| CREATE TABLE stations( | ||
| id varchar(64), | ||
| synop int, | ||
| name varchar(64), | ||
| state char(2), | ||
| country char(2), | ||
| elevation real, | ||
| network varchar(20), | ||
| online boolean, | ||
| params varchar(300), | ||
| county varchar(50), | ||
| plot_name varchar(64), | ||
| climate_site varchar(6), | ||
| remote_id int, | ||
| nwn_id int, | ||
| spri smallint, | ||
| wfo varchar(3), | ||
| archive_begin date, | ||
| archive_end date, | ||
| modified timestamp with time zone, | ||
| tzname varchar(32), | ||
| iemid SERIAL, | ||
| metasite boolean, | ||
| sigstage_low real, | ||
| sigstage_action real, | ||
| sigstage_bankfull real, | ||
| sigstage_flood real, | ||
| sigstage_moderate real, | ||
| sigstage_major real, | ||
| sigstage_record real, | ||
| ugc_county char(6), | ||
| ugc_zone char(6), | ||
| ncdc81 varchar(11), | ||
| ncei91 varchar(11), | ||
| temp24_hour smallint, | ||
| precip24_hour smallint, | ||
| wigos varchar(64), | ||
| geom geometry(POINT, 4326) | ||
| ); | ||
| alter table stations owner to mesonet; | ||
| grant select on stations to ldm,nobody; | ||
| CREATE UNIQUE index stations_idx on stations(id, network); | ||
| create UNIQUE index stations_iemid_idx on stations(iemid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
geomcolumn is present here, but missing in the upgrade scripts (upgrade/other/16.sqlandupgrade/rwis/8.sql). Ensure that the upgrade scripts also include this column to maintain consistency across the database schema.