-
Notifications
You must be signed in to change notification settings - Fork 1
/
1_CREATE_SCHEMA_HSL.sql
105 lines (91 loc) · 1.67 KB
/
1_CREATE_SCHEMA_HSL.sql
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* Drop existing tables and create them for loading raw GTFS-data */
DROP TABLE IF EXISTS HSLroutes CASCADE;
CREATE TABLE public.HSLroutes
(
route_id text,
agency_id text,
route_short_name text,
route_long_name text,
route_desc text,
route_type smallint,
route_url text
)
WITH (
OIDS = FALSE
)
;
DROP TABLE IF EXISTS HSLcalendar CASCADE;
CREATE TABLE public.HSLcalendar
(
service_id text,
monday smallint,
tuesday smallint,
wednesday smallint,
thursday smallint,
friday smallint,
saturday smallint,
sunday smallint,
start_date timestamp,
end_date timestamp
)
WITH (
OIDS = FALSE
)
;
DROP TABLE IF EXISTS HSLstops CASCADE;
CREATE TABLE public.HSLstops
(
stop_id text,
stop_code text,
stop_name text,
stop_desc text,
stop_lat float8,
stop_lon float8,
zone_id text,
stop_url text,
location_type smallint,
parent_station text,
wheelchair_boarding smallint,
platform_code text,
vehicle_type smallint
)
WITH (
OIDS = FALSE
)
;
DROP TABLE IF EXISTS HSLstop_times CASCADE;
CREATE TABLE public.HSLstop_times
(
trip_id text,
arrival_time text,
departure_time text,
stop_id text,
stop_sequence smallint,
stop_headsign text,
pickup_type smallint,
drop_off_type smallint,
shape_dist_traveled numeric,
timepoint smallint
)
WITH (
OIDS = FALSE
)
;
DROP TABLE IF EXISTS HSLtrips CASCADE;
CREATE TABLE public.HSLtrips
(
route_id text,
service_id text,
trip_id text,
trip_headsign text,
direction_id smallint,
shape_id text,
wheelchair_accessible smallint,
bikes_allowed smallint,
max_delay smallint
)
WITH (
OIDS = FALSE
)
;
CREATE EXTENSION postgis;