From 508a0999bcb5492433ff320d6ea7fccc2bba6b4e Mon Sep 17 00:00:00 2001 From: Jon Zimbel Date: Mon, 4 Nov 2024 10:48:30 -0500 Subject: [PATCH] chore: Fix structure.sql to align with what current migrations produce --- priv/repo/structure.sql | 875 ++++++---------------------------------- 1 file changed, 129 insertions(+), 746 deletions(-) diff --git a/priv/repo/structure.sql b/priv/repo/structure.sql index 467e6be9..2fe3a2aa 100644 --- a/priv/repo/structure.sql +++ b/priv/repo/structure.sql @@ -31,6 +31,45 @@ CREATE TYPE public.day_name AS ENUM ( ); +-- +-- Name: direction_desc; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE public.direction_desc AS ENUM ( + 'North', + 'South', + 'East', + 'West', + 'Northeast', + 'Northwest', + 'Southeast', + 'Southwest', + 'Clockwise', + 'Counterclockwise', + 'Inbound', + 'Outbound', + 'Loop A', + 'Loop B', + 'Loop' +); + + +-- +-- Name: fare_class; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE public.fare_class AS ENUM ( + 'Local Bus', + 'Inner Express', + 'Outer Express', + 'Rapid Transit', + 'Commuter Rail', + 'Ferry', + 'Free', + 'Special' +); + + -- -- Name: oban_job_state; Type: TYPE; Schema: public; Owner: - -- @@ -46,6 +85,23 @@ CREATE TYPE public.oban_job_state AS ENUM ( ); +-- +-- Name: route_desc; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE public.route_desc AS ENUM ( + 'Commuter Rail', + 'Rapid Transit', + 'Local Bus', + 'Key Bus', + 'Supplemental Bus', + 'Community Bus', + 'Commuter Bus', + 'Ferry', + 'Rail Replacement Bus' +); + + SET default_tablespace = ''; SET default_table_access_method = heap; @@ -372,35 +428,6 @@ CREATE TABLE public.gtfs_agencies ( ); --- --- Name: gtfs_bike_boarding_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_bike_boarding_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_bike_boarding_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_bike_boarding_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_bike_boarding_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_bike_boarding_types_id_seq OWNED BY public.gtfs_bike_boarding_types.id; - - -- -- Name: gtfs_calendar_dates; Type: TABLE; Schema: public; Owner: - -- @@ -409,7 +436,8 @@ CREATE TABLE public.gtfs_calendar_dates ( service_id character varying(255) NOT NULL, date date NOT NULL, exception_type integer NOT NULL, - holiday_name character varying(255) + holiday_name character varying(255), + CONSTRAINT exception_type_must_be_in_range CHECK ((exception_type <@ int4range(1, 2, '[]'::text))) ); @@ -431,35 +459,6 @@ CREATE TABLE public.gtfs_calendars ( ); --- --- Name: gtfs_canonicalities; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_canonicalities ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_canonicalities_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_canonicalities_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_canonicalities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_canonicalities_id_seq OWNED BY public.gtfs_canonicalities.id; - - -- -- Name: gtfs_checkpoints; Type: TABLE; Schema: public; Owner: - -- @@ -470,35 +469,6 @@ CREATE TABLE public.gtfs_checkpoints ( ); --- --- Name: gtfs_continuous_pickup_drop_off_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_continuous_pickup_drop_off_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_continuous_pickup_drop_off_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_continuous_pickup_drop_off_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_continuous_pickup_drop_off_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_continuous_pickup_drop_off_types_id_seq OWNED BY public.gtfs_continuous_pickup_drop_off_types.id; - - -- -- Name: gtfs_directions; Type: TABLE; Schema: public; Owner: - -- @@ -506,7 +476,7 @@ ALTER SEQUENCE public.gtfs_continuous_pickup_drop_off_types_id_seq OWNED BY publ CREATE TABLE public.gtfs_directions ( route_id character varying(255) NOT NULL, direction_id integer NOT NULL, - "desc" character varying(255) NOT NULL, + "desc" public.direction_desc NOT NULL, destination character varying(255) NOT NULL ); @@ -554,122 +524,6 @@ CREATE TABLE public.gtfs_lines ( ); --- --- Name: gtfs_listed_routes; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_listed_routes ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_listed_routes_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_listed_routes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_listed_routes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_listed_routes_id_seq OWNED BY public.gtfs_listed_routes.id; - - --- --- Name: gtfs_location_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_location_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_location_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_location_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_location_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_location_types_id_seq OWNED BY public.gtfs_location_types.id; - - --- --- Name: gtfs_pickup_drop_off_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_pickup_drop_off_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_pickup_drop_off_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_pickup_drop_off_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_pickup_drop_off_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_pickup_drop_off_types_id_seq OWNED BY public.gtfs_pickup_drop_off_types.id; - - --- --- Name: gtfs_route_pattern_typicalities; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_route_pattern_typicalities ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_route_pattern_typicalities_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_route_pattern_typicalities_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_route_pattern_typicalities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_route_pattern_typicalities_id_seq OWNED BY public.gtfs_route_pattern_typicalities.id; - - -- -- Name: gtfs_route_patterns; Type: TABLE; Schema: public; Owner: - -- @@ -683,39 +537,12 @@ CREATE TABLE public.gtfs_route_patterns ( typicality integer NOT NULL, sort_order integer NOT NULL, representative_trip_id character varying(255) NOT NULL, - canonical integer NOT NULL -); - - --- --- Name: gtfs_route_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_route_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL + canonical integer NOT NULL, + CONSTRAINT canonical_must_be_in_range CHECK ((canonical <@ int4range(0, 2, '[]'::text))), + CONSTRAINT typicality_must_be_in_range CHECK ((typicality <@ int4range(0, 5, '[]'::text))) ); --- --- Name: gtfs_route_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_route_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_route_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_route_types_id_seq OWNED BY public.gtfs_route_types.id; - - -- -- Name: gtfs_routes; Type: TABLE; Schema: public; Owner: - -- @@ -725,48 +552,21 @@ CREATE TABLE public.gtfs_routes ( agency_id character varying(255) NOT NULL, short_name character varying(255), long_name character varying(255), - "desc" character varying(255) NOT NULL, + "desc" public.route_desc NOT NULL, type integer NOT NULL, url character varying(255), color character varying(255), text_color character varying(255), sort_order integer NOT NULL, - fare_class character varying(255) NOT NULL, + fare_class public.fare_class NOT NULL, line_id character varying(255), listed_route integer, - network_id character varying(255) NOT NULL -); - - --- --- Name: gtfs_service_exception_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_service_exception_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL + network_id character varying(255) NOT NULL, + CONSTRAINT listed_route_must_be_in_range CHECK ((listed_route <@ int4range(0, 1, '[]'::text))), + CONSTRAINT type_must_be_in_range CHECK ((type <@ int4range(0, 4, '[]'::text))) ); --- --- Name: gtfs_service_exception_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_service_exception_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_service_exception_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_service_exception_types_id_seq OWNED BY public.gtfs_service_exception_types.id; - - -- -- Name: gtfs_services; Type: TABLE; Schema: public; Owner: - -- @@ -814,7 +614,12 @@ CREATE TABLE public.gtfs_stop_times ( timepoint integer, checkpoint_id character varying(255), continuous_pickup integer, - continuous_drop_off integer + continuous_drop_off integer, + CONSTRAINT continuous_drop_off_must_be_in_range CHECK ((continuous_drop_off <@ int4range(0, 3, '[]'::text))), + CONSTRAINT continuous_pickup_must_be_in_range CHECK ((continuous_pickup <@ int4range(0, 3, '[]'::text))), + CONSTRAINT drop_off_type_must_be_in_range CHECK ((drop_off_type <@ int4range(0, 3, '[]'::text))), + CONSTRAINT pickup_type_must_be_in_range CHECK ((pickup_type <@ int4range(0, 3, '[]'::text))), + CONSTRAINT timepoint_must_be_in_range CHECK ((timepoint <@ int4range(0, 1, '[]'::text))) ); @@ -841,39 +646,13 @@ CREATE TABLE public.gtfs_stops ( municipality character varying(255), on_street character varying(255), at_street character varying(255), - vehicle_type integer + vehicle_type integer, + CONSTRAINT location_type_must_be_in_range CHECK ((location_type <@ int4range(0, 4, '[]'::text))), + CONSTRAINT vehicle_type_must_be_in_range CHECK ((vehicle_type <@ int4range(0, 4, '[]'::text))), + CONSTRAINT wheelchair_boarding_must_be_in_range CHECK ((wheelchair_boarding <@ int4range(0, 2, '[]'::text))) ); --- --- Name: gtfs_timepoint_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_timepoint_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_timepoint_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_timepoint_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_timepoint_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_timepoint_types_id_seq OWNED BY public.gtfs_timepoint_types.id; - - -- -- Name: gtfs_trips; Type: TABLE; Schema: public; Owner: - -- @@ -890,39 +669,13 @@ CREATE TABLE public.gtfs_trips ( wheelchair_accessible integer NOT NULL, route_type integer, route_pattern_id character varying(255) NOT NULL, - bikes_allowed integer NOT NULL + bikes_allowed integer NOT NULL, + CONSTRAINT bikes_allowed_must_be_in_range CHECK ((bikes_allowed <@ int4range(0, 2, '[]'::text))), + CONSTRAINT route_type_must_be_in_range CHECK ((route_type <@ int4range(0, 4, '[]'::text))), + CONSTRAINT wheelchair_accessible_must_be_in_range CHECK ((wheelchair_accessible <@ int4range(0, 2, '[]'::text))) ); --- --- Name: gtfs_wheelchair_boarding_types; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.gtfs_wheelchair_boarding_types ( - id bigint NOT NULL, - name character varying(255) NOT NULL -); - - --- --- Name: gtfs_wheelchair_boarding_types_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.gtfs_wheelchair_boarding_types_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: gtfs_wheelchair_boarding_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.gtfs_wheelchair_boarding_types_id_seq OWNED BY public.gtfs_wheelchair_boarding_types.id; - - -- -- Name: oban_jobs; Type: TABLE; Schema: public; Owner: - -- @@ -1137,191 +890,114 @@ CREATE SEQUENCE public.shuttles_id_seq -- Name: shuttles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- -ALTER SEQUENCE public.shuttles_id_seq OWNED BY public.shuttles.id; - - --- --- Name: stops; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.stops ( - id bigint NOT NULL, - stop_id character varying(255) NOT NULL, - stop_name character varying(255) NOT NULL, - stop_desc character varying(255) NOT NULL, - platform_code character varying(255), - platform_name character varying(255), - stop_lat double precision NOT NULL, - stop_lon double precision NOT NULL, - stop_address character varying(255), - zone_id character varying(255), - level_id character varying(255), - parent_station character varying(255), - municipality character varying(255) NOT NULL, - on_street character varying(255), - at_street character varying(255), - inserted_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL -); - - --- --- Name: stops_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.stops_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: stops_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.stops_id_seq OWNED BY public.stops.id; - - --- --- Name: adjustments id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.adjustments ALTER COLUMN id SET DEFAULT nextval('public.adjustments_id_seq'::regclass); - - --- --- Name: auth_tokens id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.auth_tokens ALTER COLUMN id SET DEFAULT nextval('public.auth_tokens_id_seq'::regclass); - - --- --- Name: disruption_adjustments id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_adjustments ALTER COLUMN id SET DEFAULT nextval('public.disruption_adjustments_id_seq'::regclass); - - --- --- Name: disruption_day_of_weeks id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_day_of_weeks ALTER COLUMN id SET DEFAULT nextval('public.disruption_day_of_weeks_id_seq'::regclass); - - --- --- Name: disruption_exceptions id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_exceptions ALTER COLUMN id SET DEFAULT nextval('public.disruption_exceptions_id_seq'::regclass); - - --- --- Name: disruption_notes id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_notes ALTER COLUMN id SET DEFAULT nextval('public.disruption_notes_id_seq'::regclass); - - --- --- Name: disruption_revisions id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_revisions ALTER COLUMN id SET DEFAULT nextval('public.disruptions_id_seq'::regclass); - - --- --- Name: disruption_trip_short_names id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.disruption_trip_short_names ALTER COLUMN id SET DEFAULT nextval('public.disruption_trip_short_names_id_seq'::regclass); +ALTER SEQUENCE public.shuttles_id_seq OWNED BY public.shuttles.id; -- --- Name: disruptions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: stops; Type: TABLE; Schema: public; Owner: - -- -ALTER TABLE ONLY public.disruptions ALTER COLUMN id SET DEFAULT nextval('public.disruptions_id_seq1'::regclass); +CREATE TABLE public.stops ( + id bigint NOT NULL, + stop_id character varying(255) NOT NULL, + stop_name character varying(255) NOT NULL, + stop_desc character varying(255) NOT NULL, + platform_code character varying(255), + platform_name character varying(255), + stop_lat double precision NOT NULL, + stop_lon double precision NOT NULL, + stop_address character varying(255), + zone_id character varying(255), + level_id character varying(255), + parent_station character varying(255), + municipality character varying(255) NOT NULL, + on_street character varying(255), + at_street character varying(255), + inserted_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); -- --- Name: gtfs_bike_boarding_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: stops_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_bike_boarding_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_bike_boarding_types_id_seq'::regclass); +CREATE SEQUENCE public.stops_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; -- --- Name: gtfs_canonicalities id; Type: DEFAULT; Schema: public; Owner: - +-- Name: stops_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_canonicalities ALTER COLUMN id SET DEFAULT nextval('public.gtfs_canonicalities_id_seq'::regclass); +ALTER SEQUENCE public.stops_id_seq OWNED BY public.stops.id; -- --- Name: gtfs_continuous_pickup_drop_off_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: adjustments id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_continuous_pickup_drop_off_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_continuous_pickup_drop_off_types_id_seq'::regclass); +ALTER TABLE ONLY public.adjustments ALTER COLUMN id SET DEFAULT nextval('public.adjustments_id_seq'::regclass); -- --- Name: gtfs_listed_routes id; Type: DEFAULT; Schema: public; Owner: - +-- Name: auth_tokens id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_listed_routes ALTER COLUMN id SET DEFAULT nextval('public.gtfs_listed_routes_id_seq'::regclass); +ALTER TABLE ONLY public.auth_tokens ALTER COLUMN id SET DEFAULT nextval('public.auth_tokens_id_seq'::regclass); -- --- Name: gtfs_location_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_adjustments id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_location_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_location_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_adjustments ALTER COLUMN id SET DEFAULT nextval('public.disruption_adjustments_id_seq'::regclass); -- --- Name: gtfs_pickup_drop_off_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_day_of_weeks id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_pickup_drop_off_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_pickup_drop_off_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_day_of_weeks ALTER COLUMN id SET DEFAULT nextval('public.disruption_day_of_weeks_id_seq'::regclass); -- --- Name: gtfs_route_pattern_typicalities id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_exceptions id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_route_pattern_typicalities ALTER COLUMN id SET DEFAULT nextval('public.gtfs_route_pattern_typicalities_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_exceptions ALTER COLUMN id SET DEFAULT nextval('public.disruption_exceptions_id_seq'::regclass); -- --- Name: gtfs_route_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_notes id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_route_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_route_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_notes ALTER COLUMN id SET DEFAULT nextval('public.disruption_notes_id_seq'::regclass); -- --- Name: gtfs_service_exception_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_revisions id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_service_exception_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_service_exception_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_revisions ALTER COLUMN id SET DEFAULT nextval('public.disruptions_id_seq'::regclass); -- --- Name: gtfs_timepoint_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruption_trip_short_names id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_timepoint_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_timepoint_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruption_trip_short_names ALTER COLUMN id SET DEFAULT nextval('public.disruption_trip_short_names_id_seq'::regclass); -- --- Name: gtfs_wheelchair_boarding_types id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disruptions id; Type: DEFAULT; Schema: public; Owner: - -- -ALTER TABLE ONLY public.gtfs_wheelchair_boarding_types ALTER COLUMN id SET DEFAULT nextval('public.gtfs_wheelchair_boarding_types_id_seq'::regclass); +ALTER TABLE ONLY public.disruptions ALTER COLUMN id SET DEFAULT nextval('public.disruptions_id_seq1'::regclass); -- @@ -1446,14 +1122,6 @@ ALTER TABLE ONLY public.gtfs_agencies ADD CONSTRAINT gtfs_agencies_pkey PRIMARY KEY (id); --- --- Name: gtfs_bike_boarding_types gtfs_bike_boarding_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_bike_boarding_types - ADD CONSTRAINT gtfs_bike_boarding_types_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_calendar_dates gtfs_calendar_dates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1470,14 +1138,6 @@ ALTER TABLE ONLY public.gtfs_calendars ADD CONSTRAINT gtfs_calendars_pkey PRIMARY KEY (service_id); --- --- Name: gtfs_canonicalities gtfs_canonicalities_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_canonicalities - ADD CONSTRAINT gtfs_canonicalities_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_checkpoints gtfs_checkpoints_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1486,14 +1146,6 @@ ALTER TABLE ONLY public.gtfs_checkpoints ADD CONSTRAINT gtfs_checkpoints_pkey PRIMARY KEY (id); --- --- Name: gtfs_continuous_pickup_drop_off_types gtfs_continuous_pickup_drop_off_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_continuous_pickup_drop_off_types - ADD CONSTRAINT gtfs_continuous_pickup_drop_off_types_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_directions gtfs_directions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1526,38 +1178,6 @@ ALTER TABLE ONLY public.gtfs_lines ADD CONSTRAINT gtfs_lines_pkey PRIMARY KEY (id); --- --- Name: gtfs_listed_routes gtfs_listed_routes_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_listed_routes - ADD CONSTRAINT gtfs_listed_routes_pkey PRIMARY KEY (id); - - --- --- Name: gtfs_location_types gtfs_location_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_location_types - ADD CONSTRAINT gtfs_location_types_pkey PRIMARY KEY (id); - - --- --- Name: gtfs_pickup_drop_off_types gtfs_pickup_drop_off_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_pickup_drop_off_types - ADD CONSTRAINT gtfs_pickup_drop_off_types_pkey PRIMARY KEY (id); - - --- --- Name: gtfs_route_pattern_typicalities gtfs_route_pattern_typicalities_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_route_pattern_typicalities - ADD CONSTRAINT gtfs_route_pattern_typicalities_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_route_patterns gtfs_route_patterns_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1566,14 +1186,6 @@ ALTER TABLE ONLY public.gtfs_route_patterns ADD CONSTRAINT gtfs_route_patterns_pkey PRIMARY KEY (id); --- --- Name: gtfs_route_types gtfs_route_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_route_types - ADD CONSTRAINT gtfs_route_types_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_routes gtfs_routes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1582,14 +1194,6 @@ ALTER TABLE ONLY public.gtfs_routes ADD CONSTRAINT gtfs_routes_pkey PRIMARY KEY (id); --- --- Name: gtfs_service_exception_types gtfs_service_exception_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_service_exception_types - ADD CONSTRAINT gtfs_service_exception_types_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_services gtfs_services_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1630,14 +1234,6 @@ ALTER TABLE ONLY public.gtfs_stops ADD CONSTRAINT gtfs_stops_pkey PRIMARY KEY (id); --- --- Name: gtfs_timepoint_types gtfs_timepoint_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_timepoint_types - ADD CONSTRAINT gtfs_timepoint_types_pkey PRIMARY KEY (id); - - -- -- Name: gtfs_trips gtfs_trips_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -1646,14 +1242,6 @@ ALTER TABLE ONLY public.gtfs_trips ADD CONSTRAINT gtfs_trips_pkey PRIMARY KEY (id); --- --- Name: gtfs_wheelchair_boarding_types gtfs_wheelchair_boarding_types_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_wheelchair_boarding_types - ADD CONSTRAINT gtfs_wheelchair_boarding_types_pkey PRIMARY KEY (id); - - -- -- Name: oban_jobs non_negative_priority; Type: CHECK CONSTRAINT; Schema: public; Owner: - -- @@ -1789,83 +1377,6 @@ CREATE INDEX disruption_notes_disruption_id_index ON public.disruption_notes USI CREATE INDEX disruption_trip_short_names_disruption_id_index ON public.disruption_trip_short_names USING btree (disruption_revision_id); --- --- Name: gtfs_bike_boarding_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_bike_boarding_types_name_index ON public.gtfs_bike_boarding_types USING btree (name); - - --- --- Name: gtfs_canonicalities_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_canonicalities_name_index ON public.gtfs_canonicalities USING btree (name); - - --- --- Name: gtfs_continuous_pickup_drop_off_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_continuous_pickup_drop_off_types_name_index ON public.gtfs_continuous_pickup_drop_off_types USING btree (name); - - --- --- Name: gtfs_listed_routes_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_listed_routes_name_index ON public.gtfs_listed_routes USING btree (name); - - --- --- Name: gtfs_location_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_location_types_name_index ON public.gtfs_location_types USING btree (name); - - --- --- Name: gtfs_pickup_drop_off_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_pickup_drop_off_types_name_index ON public.gtfs_pickup_drop_off_types USING btree (name); - - --- --- Name: gtfs_route_pattern_typicalities_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_route_pattern_typicalities_name_index ON public.gtfs_route_pattern_typicalities USING btree (name); - - --- --- Name: gtfs_route_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_route_types_name_index ON public.gtfs_route_types USING btree (name); - - --- --- Name: gtfs_service_exception_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_service_exception_types_name_index ON public.gtfs_service_exception_types USING btree (name); - - --- --- Name: gtfs_timepoint_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_timepoint_types_name_index ON public.gtfs_timepoint_types USING btree (name); - - --- --- Name: gtfs_wheelchair_boarding_types_name_index; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX gtfs_wheelchair_boarding_types_name_index ON public.gtfs_wheelchair_boarding_types USING btree (name); - - -- -- Name: oban_jobs_args_index; Type: INDEX; Schema: public; Owner: - -- @@ -2000,14 +1511,6 @@ ALTER TABLE ONLY public.disruptions ADD CONSTRAINT disruptions_published_revision_id_fkey FOREIGN KEY (published_revision_id) REFERENCES public.disruption_revisions(id); --- --- Name: gtfs_calendar_dates gtfs_calendar_dates_exception_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_calendar_dates - ADD CONSTRAINT gtfs_calendar_dates_exception_type_fkey FOREIGN KEY (exception_type) REFERENCES public.gtfs_service_exception_types(id); - - -- -- Name: gtfs_calendar_dates gtfs_calendar_dates_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2032,14 +1535,6 @@ ALTER TABLE ONLY public.gtfs_directions ADD CONSTRAINT gtfs_directions_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.gtfs_routes(id); --- --- Name: gtfs_route_patterns gtfs_route_patterns_canonical_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_route_patterns - ADD CONSTRAINT gtfs_route_patterns_canonical_fkey FOREIGN KEY (canonical) REFERENCES public.gtfs_canonicalities(id); - - -- -- Name: gtfs_route_patterns gtfs_route_patterns_direction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2064,14 +1559,6 @@ ALTER TABLE ONLY public.gtfs_route_patterns ADD CONSTRAINT gtfs_route_patterns_route_id_fkey FOREIGN KEY (route_id) REFERENCES public.gtfs_routes(id); --- --- Name: gtfs_route_patterns gtfs_route_patterns_typicality_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_route_patterns - ADD CONSTRAINT gtfs_route_patterns_typicality_fkey FOREIGN KEY (typicality) REFERENCES public.gtfs_route_pattern_typicalities(id); - - -- -- Name: gtfs_routes gtfs_routes_agency_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2088,22 +1575,6 @@ ALTER TABLE ONLY public.gtfs_routes ADD CONSTRAINT gtfs_routes_line_id_fkey FOREIGN KEY (line_id) REFERENCES public.gtfs_lines(id); --- --- Name: gtfs_routes gtfs_routes_listed_route_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_routes - ADD CONSTRAINT gtfs_routes_listed_route_fkey FOREIGN KEY (listed_route) REFERENCES public.gtfs_listed_routes(id); - - --- --- Name: gtfs_routes gtfs_routes_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_routes - ADD CONSTRAINT gtfs_routes_type_fkey FOREIGN KEY (type) REFERENCES public.gtfs_route_types(id); - - -- -- Name: gtfs_shape_points gtfs_shape_points_shape_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2120,38 +1591,6 @@ ALTER TABLE ONLY public.gtfs_stop_times ADD CONSTRAINT gtfs_stop_times_checkpoint_id_fkey FOREIGN KEY (checkpoint_id) REFERENCES public.gtfs_checkpoints(id); --- --- Name: gtfs_stop_times gtfs_stop_times_continuous_drop_off_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stop_times - ADD CONSTRAINT gtfs_stop_times_continuous_drop_off_fkey FOREIGN KEY (continuous_drop_off) REFERENCES public.gtfs_continuous_pickup_drop_off_types(id); - - --- --- Name: gtfs_stop_times gtfs_stop_times_continuous_pickup_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stop_times - ADD CONSTRAINT gtfs_stop_times_continuous_pickup_fkey FOREIGN KEY (continuous_pickup) REFERENCES public.gtfs_continuous_pickup_drop_off_types(id); - - --- --- Name: gtfs_stop_times gtfs_stop_times_drop_off_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stop_times - ADD CONSTRAINT gtfs_stop_times_drop_off_type_fkey FOREIGN KEY (drop_off_type) REFERENCES public.gtfs_pickup_drop_off_types(id); - - --- --- Name: gtfs_stop_times gtfs_stop_times_pickup_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stop_times - ADD CONSTRAINT gtfs_stop_times_pickup_type_fkey FOREIGN KEY (pickup_type) REFERENCES public.gtfs_pickup_drop_off_types(id); - - -- -- Name: gtfs_stop_times gtfs_stop_times_stop_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2160,14 +1599,6 @@ ALTER TABLE ONLY public.gtfs_stop_times ADD CONSTRAINT gtfs_stop_times_stop_id_fkey FOREIGN KEY (stop_id) REFERENCES public.gtfs_stops(id); --- --- Name: gtfs_stop_times gtfs_stop_times_timepoint_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stop_times - ADD CONSTRAINT gtfs_stop_times_timepoint_fkey FOREIGN KEY (timepoint) REFERENCES public.gtfs_timepoint_types(id); - - -- -- Name: gtfs_stop_times gtfs_stop_times_trip_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2184,14 +1615,6 @@ ALTER TABLE ONLY public.gtfs_stops ADD CONSTRAINT gtfs_stops_level_id_fkey FOREIGN KEY (level_id) REFERENCES public.gtfs_levels(id); --- --- Name: gtfs_stops gtfs_stops_location_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stops - ADD CONSTRAINT gtfs_stops_location_type_fkey FOREIGN KEY (location_type) REFERENCES public.gtfs_location_types(id); - - -- -- Name: gtfs_stops gtfs_stops_parent_station_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2200,30 +1623,6 @@ ALTER TABLE ONLY public.gtfs_stops ADD CONSTRAINT gtfs_stops_parent_station_id_fkey FOREIGN KEY (parent_station_id) REFERENCES public.gtfs_stops(id); --- --- Name: gtfs_stops gtfs_stops_vehicle_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stops - ADD CONSTRAINT gtfs_stops_vehicle_type_fkey FOREIGN KEY (vehicle_type) REFERENCES public.gtfs_route_types(id); - - --- --- Name: gtfs_stops gtfs_stops_wheelchair_boarding_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_stops - ADD CONSTRAINT gtfs_stops_wheelchair_boarding_fkey FOREIGN KEY (wheelchair_boarding) REFERENCES public.gtfs_wheelchair_boarding_types(id); - - --- --- Name: gtfs_trips gtfs_trips_bikes_allowed_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_trips - ADD CONSTRAINT gtfs_trips_bikes_allowed_fkey FOREIGN KEY (bikes_allowed) REFERENCES public.gtfs_bike_boarding_types(id); - - -- -- Name: gtfs_trips gtfs_trips_direction_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2248,14 +1647,6 @@ ALTER TABLE ONLY public.gtfs_trips ADD CONSTRAINT gtfs_trips_route_pattern_id_fkey FOREIGN KEY (route_pattern_id) REFERENCES public.gtfs_route_patterns(id); --- --- Name: gtfs_trips gtfs_trips_route_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_trips - ADD CONSTRAINT gtfs_trips_route_type_fkey FOREIGN KEY (route_type) REFERENCES public.gtfs_route_types(id); - - -- -- Name: gtfs_trips gtfs_trips_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -2272,14 +1663,6 @@ ALTER TABLE ONLY public.gtfs_trips ADD CONSTRAINT gtfs_trips_shape_id_fkey FOREIGN KEY (shape_id) REFERENCES public.gtfs_shapes(id); --- --- Name: gtfs_trips gtfs_trips_wheelchair_accessible_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.gtfs_trips - ADD CONSTRAINT gtfs_trips_wheelchair_accessible_fkey FOREIGN KEY (wheelchair_accessible) REFERENCES public.gtfs_wheelchair_boarding_types(id); - - -- -- Name: shuttle_route_stops shuttle_route_stops_shuttle_route_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - --