chore: clean up

This commit is contained in:
dancingCycle 2024-01-03 18:49:05 +01:00
parent 7ccbbcaa97
commit ac352c788d
2 changed files with 0 additions and 19 deletions

View File

@ -1,10 +0,0 @@
-- colon before variable: for a prepared statement using named placeholders, this will be a parameter name of the form :name
CREATE SCHEMA IF NOT EXISTS :schema;
CREATE SCHEMA IF NOT EXISTS :schema_gtfsr;
SET search_path to :schema, :schema_gtfsr, public;
---create view
DROP VIEW IF EXISTS :schema.vw_join_rts_trps_srvcs_pdts;
CREATE OR REPLACE VIEW :schema.vw_join_rts_trps_srvcs_pdts AS
SELECT rts.route_id, rts.route_short_name, rts.route_long_name, trps.service_id, trps.trip_id, trps.trip_short_name, trps.trip_headsign, srvcs.dates, pdts.timestamp_pgsql FROM :schema.trips AS trps LEFT JOIN :schema.routes AS rts ON trps.route_id = rts.route_id LEFT JOIN :schema.services AS srvcs ON trps.service_id = srvcs.service_id LEFT JOIN :schema_gtfsr.trip_updates AS pdts ON trps.route_id = pdts.trip_route_id AND trps.trip_id = pdts.trip_trip_id ORDER BY rts.route_id, trps.trip_id;

View File

@ -1,9 +0,0 @@
-- colon before variable: for a prepared statement using named placeholders, this will be a parameter name of the form :name
CREATE SCHEMA IF NOT EXISTS :schema;
SET search_path to :schema, public;
---create view
DROP VIEW IF EXISTS :schema.vw_join_rts_trps_srvcs;
CREATE OR REPLACE VIEW :schema.vw_join_rts_trps_srvcs AS
SELECT rts.route_id, rts.route_short_name, rts.route_long_name, trps.service_id, trps.trip_id, trps.trip_short_name, trps.trip_headsign, srvcs.dates FROM :schema.trips AS trps LEFT JOIN :schema.routes AS rts ON trps.route_id = rts.route_id LEFT JOIN :schema.services AS srvcs ON trps.service_id = srvcs.service_id ORDER BY rts.route_id, trps.trip_id;