-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
81 lines (68 loc) · 2.04 KB
/
Copy pathschema.sql
File metadata and controls
81 lines (68 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
create table public.spatial_ref_sys
(
srid integer not null
primary key
constraint spatial_ref_sys_srid_check
check ((srid > 0) AND (srid <= 998999)),
auth_name varchar(256),
auth_srid integer,
srtext varchar(2048),
proj4text varchar(2048)
);
alter table public.spatial_ref_sys
owner to jc;
grant select on public.spatial_ref_sys to public;
create table public.schema_migrations
(
version bigint not null
primary key,
dirty boolean not null
);
alter table public.schema_migrations
owner to jc;
create table public.nws_offices
(
id varchar(3) not null
constraint nws_office_id_pkey
primary key,
city varchar(255),
state varchar(2)
);
alter table public.nws_offices
owner to jc;
create type report_type as enum (
'hail',
'wind',
'tornado'
);
create table public.reports
(
rpt_type report_type not null,
reported_time timestamp with time zone not null,
created_at timestamp with time zone,
var_col integer,
dist_from_location integer not null,
heading_from_location varchar(3) not null,
county varchar(255) not null,
state varchar(2),
latitude varchar(50),
longitude varchar(50),
event_location geometry,
comments text,
nws_office varchar(3),
location varchar(255) not null,
constraint reports_id_pkey
primary key (rpt_type, reported_time, location, heading_from_location, dist_from_location, county)
);
alter table public.reports
owner to jc;
create index reports_geom_idx
on public.reports using gist (geography(event_location));
create table public.xref_report_type_var_col
(
rpt_type report_type not null
primary key,
column_heading varchar(20) not null
);
alter table public.xref_report_type_var_col
owner to jc;