-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.sql
More file actions
55 lines (47 loc) · 1.39 KB
/
create.sql
File metadata and controls
55 lines (47 loc) · 1.39 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
-- create the database
\i 'database/db_mobiles.sql';
-- switch to using the database
\c mobiles_temp;
-- setup any extensions
\i 'database/db_extensions.sql';
-- setup any extensions
\i 'database/db_r_rule_functions.sql';
-- set client encoding
set client_encoding = 'UTF8';
-- create tables
\i 'tables/tbl_country.sql';
\i 'tables/tbl_organisation.sql';
\i 'tables/tbl_mobile.sql';
\i 'tables/tbl_route.sql';
\i 'tables/tbl_route_schedule.sql';
\i 'tables/tbl_stop.sql';
\i 'tables/tbl_route_stop.sql';
\i 'tables/tbl_trip.sql';
\i 'tables/tbl_trip_staging.sql';
\i 'tables/tbl_location.sql';
\i 'tables/tbl_staging.sql';
\i 'tables/tbl_updates.sql';
-- create views
\i 'views/vw_organisations.sql';
\i 'views/vw_mobiles.sql';
\i 'views/vw_routes.sql';
\i 'views/vw_stops.sql';
\i 'views/vw_stops_timetable.sql';
\i 'views/vw_trips.sql';
\i 'views/vw_schema.sql';
\i 'views/vw_mobiles_status.sql';
\i 'views/vw_mobiles_location.sql';
-- create functions
\i 'functions/fn_load_stops_staging.sql';
\i 'functions/fn_load_trips_staging.sql';
\i 'functions/fn_bbox.sql';
\i 'functions/fn_stops_mvt.sql';
\i 'functions/fn_trips_mvt.sql';
\i 'functions/fn_update_estimate_locations.sql';
\i 'functions/fn_update_route_schedule.sql';
\i 'functions/fn_updates.sql';
\i 'functions/fn_estimate_location.sql';
\i 'functions/fn_estimate_route_section.sql';
\i 'functions/fn_mobiles_nearest.sql';
-- load in data
\i 'load.sql';