Home

Awesome

Simple Schema Manager

Eh, I am sure there are much better ways to manage database schema than this, but alas, here it is. Fundamentally, we support the following scenarios.

  1. A newly setup PostgreSQL database.
  2. An upgrade path from previously deployed databases
  3. A means to bootstrap a database schema and some initial data to support CI testing.

The init folder contains the initial schema plus incremental changes that are also tracked in sequential upgrade files. A recent change was to update the files in init with any schema updates made. The magic happens with a dedicated table in each database known as iem_schema_manager_version, which tracks a integer value representing the most recent schema update made.

Simply running:

python schema_manager.py

and things should take care of themselves. The bootstrap.sh exists for initial deployments, like on CI.

Bundled test data

To support integration tests, some real data is bundled here for loading into the database via store_test_data.py. Some terse details on these files in the data folder:

FilenameContains
afos_products.sql.gzAFDDMX from 10-16 Jul 2024
asos__000taf.sqlTAF reference table for 20 Aug 2024
asos__AMW_01_10_Aug_2024.aqlAmes data for 1-10 Aug 2024
asos__taf2024.sql.gzTAF data for 20 Aug 2024
asos_alldata.sql.gz~2020 data for AMW and DSM
asos1min_DSMAMW.sql.gzOne Minute ASOS 10-12 July 2024 DSM+AMW
coop__IA0000_IATAME_2000_2024.sql.gzclimodat IA0000,IATAME,IA0200 for 2000-2024(aug 25)
coop__alldata_IATDSM.sql.gzclimodat IATDSM for 2000-2024(aug 15)
coop__climate51.sqlclimate51 data for IATAME,IATDSM,IA0000
coop__climate71.sqlclimate71 data for IATAME,IATDSM,IA0000
coop__climate81.sqlclimate81 data for IATAME,IATDSM,IA0000
coop__elnino.sqlEl Nino data till Aug 2024
coop__nass_quickstats.sql.gzNASS Quickstats 2007-Aug 2024
coop__ncei_climdiv_IA0000.sqlNCEI Climdiv data for Iowa Statewide
coop_ncei_climate71_ames.sqlNCEI 71 Climatology for Ames
coop_ncei_climate81_ames.sqlNCEI 81 Climatology for Ames
coop_ncei_climate91_ames.sqlNCEI 91 Climatology for Ames
hads_alldata.sql.gz2024 weather variables for EOKI4
hads_snowfall.sql10 Nov 2023 12 UTC fake entries for DNKI4
hml__000hml_forecast.sqlGuttenburg GTTI4 20-23 Aug 2024
hml__hml_forecast_data.sqlGuttenburg GTTI4 20-23 Aug 2024
hml__hml_observed_data.sqlGuttenburg GTTI4 20-23 Aug 2024
iem__hourly.sql.gzDSM,AMW hourly precip 2024 precip till 4 Sept
iem__AMWDSM.sql.gzIEM current,current_log,summary_2024 (14 Aug) for AMW+DSM
iem__cf6data.sqlCF6 Data for DSM 2024 till 26 Jul
iem__clidata.sqlCLI Data for DSM 2024 till 26 Jul
iem__summary_iacoop_241022.sqlIowa COOP summary data for 22 Oct 2024
iem__summary2020.sql.gzAmes, Des Moines summary data for 2020
isuag_daily.sql.gzISU Ag Climate station A130209 (Ames)
isuag__hourly.sqlISU Ag Climate station A130209 (Ames) 2,000 hourly
isuag_sm_minute.sql.gzISU Soil Moisture minute data 21-25 July 2024
isuag_sm_hourly.sql.gzISU Soil Moisture hourly data 21-25 July 2024
isuag__sm_hourly.sql.gzMore AEEI4 hourly data
isuag_sm_daily.sqlISU Soil Moisture daily data 21-25 July 2024
isuag_sm_inversion.sql.gzISU Soil Moisture inversion data 21-25 July 2024
mesosite__camera_log_2020.sqlWebcam metadata around 17z 10 Aug 2020
mesosite_products.sqlArchived products metadata
mesosite_tzworld_chicago.sql.gzLargest geometry for America/Chicago for tz_world
mesosite_webcams.sqlSome example webcam entries
mesosite_zz_station_attrs.sqlStation attributes for
mos_20240802.sqlKDSM MOS for 2 Aug 2024 0z
mos_fake_realtime.sqlMOS faked NBS entry for KDSM valid at 0z today
other__purpleair.sqlpurpleair data for 10 Aug 2024
other__ss_bubbler.sqldata for 13 Aug 2012
other__ss_logger_data.sql2012-2014 random data
postgis_mcd.sql.gzMCDs for much of July 2024
postgis_pireps.sqlA few PIREPs on 31 July 2024
postgis__000spc_outlook.sqlSPC/WPC Outlook 1-8 Aug 2024
postgis__airmets.sqlSome AIRMETs from 10 Aug 2024
postgis__cwas.sqlSome Center Weather Advisories from 10 Aug 2024
postgis__fema_regions.sql.gzSimplified FEMA Regions
postgis__sigmets_archive.sqlSome SIGMETs from 10 Aug 2024
postgis__spc_outlook_geometries.sql.gzSPC/WPC Outlooks 1-8 Aug 2024
postgis__sps2024.sql.gzSPSs from Aug 2024
postgis_lsrs.sqlDMX LSRs from 2018-06-20,2018-06-21,2024-05-21, One BGM LSR from 2023
postgis_states.sqlSimplified 0.01 us states
postgis__text_products_oct24.sql.gzNWS misc polygons for Oct 2024
postgis__usdm.sql.gzUS Drought Monitor for 2024 till 8 Aug
postgis_warnings.sqlDMX select warnings from 2018 and 2024, OAX Emergencies 2024
postgis_warnings2020.sqlDMX selected for 2020
postgis_watches_current.sqlwatches_current snapshot 5 Aug 2024
postgis_watches2024.sql.gzwatches for 2024 till 5 Aug 2024
radar__nexrad_attributes_2024.sql.gzsampled attributes from 10 Aug 2024
radar__nexrad_attributes.sql.gznexrad attributes current (set to loadtime)
raob_240719.sql.gzAll soundings from 19 July 2024 12 UTC
rwis_atmos.sql.gzRWIS met data for 1 July 2024
rwis_soil.sqlIowa RWIS soil data for 1 July 2024
rwis_traffic.sqlIowa RWIS traffic data for 1 July 2024
talltowers_20160915.sqlTalltowers data from 15 Sep 2016