Skip to content

Commit

Permalink
untested fixes for issue #18
Browse files Browse the repository at this point in the history
  • Loading branch information
znmeb committed Jun 15, 2019
1 parent 3a742d9 commit 2dac570
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/data/3create_partitioned_tables.bash
Expand Up @@ -4,8 +4,8 @@
export DBOWNER=transportation2019
export PGDATABASE=transit_operations_analytics_data

#/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_passenger_stops.sql
/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_trips.sql
/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_passenger_stops.sql
/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f rail_passenger_stops.sql
#/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_trips.sql
#/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_all_stops.sql
#/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f disturbance_stops.sql
/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f bus_all_stops.sql
/usr/bin/time psql -U ${DBOWNER} -d ${PGDATABASE} -f disturbance_stops.sql
3 changes: 2 additions & 1 deletion src/data/bus_passenger_stops.sql
Expand Up @@ -63,7 +63,8 @@ FROM raw.raw_stop_event
WHERE (service_key = 'W' OR service_key = 'S' OR service_key = 'U' OR service_key = 'X')
AND route_number IS NOT NULL
AND route_number <= 291
AND route_number >= 1;
AND route_number >= 1
AND route_number IN (SELECT DISTINCT line_id FROM bus_trips);

\echo primary key
ALTER TABLE bus_passenger_stops
Expand Down
3 changes: 2 additions & 1 deletion src/data/rail_passenger_stops.sql
Expand Up @@ -63,7 +63,8 @@ FROM raw.raw_stop_event
WHERE (service_key = 'A' OR service_key = 'B' OR service_key = 'C')
AND route_number IS NOT NULL
AND route_number <= 291
AND route_number >= 1;
AND route_number >= 1
AND route_number IN (SELECT DISTINCT rte FROM trimet_gis.tm_routes WHERE type = 'MAX');

\echo primary key
ALTER TABLE rail_passenger_stops
Expand Down

0 comments on commit 2dac570

Please sign in to comment.