From 1eed832211c3c37ea392e267a7e0ffe603580117 Mon Sep 17 00:00:00 2001 From: Gabe Wolofsky <80077912+gabrielwol@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:42:50 -0500 Subject: [PATCH] #1088 lookup tables --- .../create-table-itsc_factors-direction.sql | 15 ++++++++++++ ...able-itsc_factors_lanesaffectedpattern.sql | 23 +++++++++++++++++++ ...-table-itsc_factors_locationblocklevel.sql | 15 ++++++++++++ ...table-itsc_factors_roadclosuretype_old.sql | 15 ++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 events/construction/sql/create-table-itsc_factors-direction.sql create mode 100644 events/construction/sql/create-table-itsc_factors_lanesaffectedpattern.sql create mode 100644 events/construction/sql/create-table-itsc_factors_locationblocklevel.sql create mode 100644 events/construction/sql/create-table-itsc_factors_roadclosuretype_old.sql diff --git a/events/construction/sql/create-table-itsc_factors-direction.sql b/events/construction/sql/create-table-itsc_factors-direction.sql new file mode 100644 index 000000000..5dac7dd4c --- /dev/null +++ b/events/construction/sql/create-table-itsc_factors-direction.sql @@ -0,0 +1,15 @@ +-- Table: itsc_factors.direction + +-- DROP TABLE IF EXISTS itsc_factors.direction; + +CREATE TABLE IF NOT EXISTS itsc_factors.direction +( + code integer NOT NULL, + direction text COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT itsc_factors_direction_pkey PRIMARY KEY (code) +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS itsc_factors.direction +OWNER TO congestion_admins; \ No newline at end of file diff --git a/events/construction/sql/create-table-itsc_factors_lanesaffectedpattern.sql b/events/construction/sql/create-table-itsc_factors_lanesaffectedpattern.sql new file mode 100644 index 000000000..77be8df88 --- /dev/null +++ b/events/construction/sql/create-table-itsc_factors_lanesaffectedpattern.sql @@ -0,0 +1,23 @@ +-- Table: itsc_factors.lanesaffectedpattern + +-- DROP TABLE IF EXISTS itsc_factors.lanesaffectedpattern; + +CREATE TABLE IF NOT EXISTS itsc_factors.lanesaffectedpattern +( + lane_status text COLLATE pg_catalog."default" NOT NULL, + code text COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT lanesaffected_pkey PRIMARY KEY (code) +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS itsc_factors.lanesaffectedpattern +OWNER TO congestion_admins; + +REVOKE ALL ON TABLE itsc_factors.lanesaffectedpattern FROM bdit_humans; + +GRANT INSERT, REFERENCES, SELECT, TRIGGER, UPDATE ON TABLE itsc_factors.lanesaffectedpattern TO bdit_humans WITH GRANT OPTION; + +GRANT ALL ON TABLE itsc_factors.lanesaffectedpattern TO congestion_admins; + +GRANT ALL ON TABLE itsc_factors.lanesaffectedpattern TO rds_superuser WITH GRANT OPTION; \ No newline at end of file diff --git a/events/construction/sql/create-table-itsc_factors_locationblocklevel.sql b/events/construction/sql/create-table-itsc_factors_locationblocklevel.sql new file mode 100644 index 000000000..31b7042cc --- /dev/null +++ b/events/construction/sql/create-table-itsc_factors_locationblocklevel.sql @@ -0,0 +1,15 @@ +-- Table: itsc_factors.locationblocklevel + +-- DROP TABLE IF EXISTS itsc_factors.locationblocklevel; + +CREATE TABLE IF NOT EXISTS itsc_factors.locationblocklevel +( + code integer NOT NULL, + locationblocklevel text COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT locationblocklevel_pkey PRIMARY KEY (code) +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS itsc_factors.locationblocklevel +OWNER TO congestion_admins; \ No newline at end of file diff --git a/events/construction/sql/create-table-itsc_factors_roadclosuretype_old.sql b/events/construction/sql/create-table-itsc_factors_roadclosuretype_old.sql new file mode 100644 index 000000000..93ff199d4 --- /dev/null +++ b/events/construction/sql/create-table-itsc_factors_roadclosuretype_old.sql @@ -0,0 +1,15 @@ +-- Table: itsc_factors.roadclosuretype_old + +-- DROP TABLE IF EXISTS itsc_factors.roadclosuretype_old; + +CREATE TABLE IF NOT EXISTS itsc_factors.roadclosuretype_old +( + code integer NOT NULL, + roadclosuretype text COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT roadclosuretype_old_pkey PRIMARY KEY (code) +) + +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS itsc_factors.roadclosuretype_old +OWNER TO congestion_admins; \ No newline at end of file