Add schema for SPC outlook areas
This commit is contained in:
parent
547545a665
commit
698ac23033
1 changed files with 33 additions and 0 deletions
33
db/xmet.sql
33
db/xmet.sql
|
@ -140,4 +140,37 @@ create table xmet_sounding_sample (
|
||||||
|
|
||||||
create index xmet_sounding_sample_sounding_id_idx on xmet_sounding_sample (sounding_id);
|
create index xmet_sounding_sample_sounding_id_idx on xmet_sounding_sample (sounding_id);
|
||||||
|
|
||||||
|
create table xmet_spc_outlook (
|
||||||
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
|
timestamp_issued TIMESTAMP NOT NULL,
|
||||||
|
timestamp_start TIMESTAMP NOT NULL,
|
||||||
|
timestamp_end TIMESTAMP NOT NULL,
|
||||||
|
day INTEGER NOT NULL,
|
||||||
|
text_raw TEXT NOT NULL,
|
||||||
|
body TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
create table xmet_spc_outlook_probability_area (
|
||||||
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
|
outlook_id INTEGER NOT NULL,
|
||||||
|
hazard TEXT NOT NULL,
|
||||||
|
probability INTEGER NOT NULL,
|
||||||
|
|
||||||
|
FOREIGN KEY (outlook_id) REFERENCES xmet_spc_outlook (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
select AddGeometryColumn('xmet_spc_outlook_probability_area', 'poly', 4326, 'POLYGON'),
|
||||||
|
CreateSpatialIndex('xmet_spc_outlook_probability_area', 'poly');
|
||||||
|
|
||||||
|
create table xmet_spc_outlook_category_area (
|
||||||
|
id INTEGER PRIMARY KEY NOT NULL,
|
||||||
|
outlook_id INTEGER NOT NULL,
|
||||||
|
category TEXT NOT NULL,
|
||||||
|
|
||||||
|
FOREIGN KEY (outlook_id) REFERENCES xmet_spc_outlook (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
select AddGeometryColumn('xmet_spc_outlook_category_area', 'poly', 4326, 'POLYGON'),
|
||||||
|
CreateSpatialIndex('xmet_spc_outlook_category_area', 'poly');
|
||||||
|
|
||||||
commit;
|
commit;
|
||||||
|
|
Loading…
Add table
Reference in a new issue