gtfs/sql/trip-updates.sql

17 lines
466 B
SQL

-- 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 table
DROP TABLE IF EXISTS :schema.trip_updates CASCADE;
CREATE TABLE IF NOT EXISTS :schema.trip_updates
(
trip_trip_id text NULL,
trip_route_id text NULL,
timestamp_gtfsr timestamptz NULL,
timestamp_pgsql timestamptz NOT NULL DEFAULT now(),
delay int
);