Create database schema for upper air soundings

This commit is contained in:
XANTRONIX 2025-02-23 20:35:53 -05:00
parent a5259dda99
commit 87d5031e92

View file

@ -90,4 +90,35 @@ select
AddGeometryColumn('xmet_afos_message', 'poly', 4326, 'POLYGON'),
CreateSpatialIndex('xmet_afos_message', 'poly');
create table xmet_sounding (
id INTEGER PRIMARY KEY NOT NULL,
station TEXT NOT NULL,
timestamp_observed TIMESTAMP NOT NULL,
timestamp_released TIMESTAMP,
sample_count INTEGER,
data_source_pressure TEXT NOT NULL,
data_source_other TEXT NOT NULL
);
select AddGeometryColumn('xmet_sounding', 'coord', 4326, 'POINT'),
CreateSpatialIndex('xmet_sounding', 'coord');
create table xmet_sounding_sample (
id INTEGER PRIMARY KEY NOT NULL,
sounding_id INTEGER NOT NULL,
elapsed INTEGER NOT NULL,
pressure FLOAT,
pressure_qa TEXT NOT NULL,
height FLOAT,
height_qa TEXT NOT NULL,
temp FLOAT,
temp_qa TEXT NOT NULL,
humidity FLOAT,
dewpoint FLOAT,
wind_dir FLOAT,
wind_speed FLOAT,
FOREIGN KEY (sounding_id) REFERENCES xmet_sounding (id)
);
commit;