diff --git a/db/nexrad.sql b/db/nexrad.sql index a996c3d..be3128c 100644 --- a/db/nexrad.sql +++ b/db/nexrad.sql @@ -12,10 +12,29 @@ create table nexrad_radar ( tower_height FLOAT NOT NULL ); -select AddGeometryColumn( - 'nexrad_radar', 'coord', 4326, 'POINT', 'XY' +select + AddGeometryColumn('nexrad_radar', 'coord', 4326, 'POINT', 'XY'), + CreateSpatialIndex('nexrad_radar', 'coord'); + +create table nexrad_storm_report ( + id INTEGER PRIMARY KEY NOT NULL, + episode_id INTEGER, + timestamp_start TIMESTAMP NOT NULL, + timestamp_end TIMESTAMP NOT NULL, + state TEXT NOT NULL, + event_type TEXT NOT NULL, + wfo TEXT NOT NULL, + locale_start TEXT NOT NULL, + locale_end TEXT NOT NULL, + tornado_f_rating TEXT ); -select CreateSpatialIndex('nexrad_radar', 'coord'); +select + AddGeometryColumn('nexrad_storm_report', 'coord_start', 4326, 'POINT', 'XY', 1), + CreateSpatialIndex('nexrad_storm_report', 'coord_start'); + +select + AddGeometryColumn('nexrad_storm_report', 'coord_end', 4326, 'POINT', 'XY', 1), + CreateSpatialIndex('nexrad_storm_report', 'coord_end'); commit;