Skip to content

Commit

Permalink
#1088 issues_locations -> issue_locations
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Dec 10, 2024
1 parent e4f4e1b commit 95a124c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion events/construction/itsc_issues_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def fetch_and_insert_location_data(
df_no_geom = df_no_geom[cols_to_insert]
df_no_geom = [tuple(x) for x in df_no_geom.to_numpy()]

insert_fpath = os.path.join(SQL_DIR, 'insert-itsc_issues_locations.sql')
insert_fpath = os.path.join(SQL_DIR, 'insert-itsc_issue_locations.sql')
with open(insert_fpath, 'r', encoding="utf-8") as file:
insert_query = sql.SQL(file.read())

Expand Down
18 changes: 9 additions & 9 deletions events/construction/sql/create_table-itsc_issues_locations.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Table: congestion_events.itsc_issues_locations
-- Table: congestion_events.itsc_issue_locations

-- DROP TABLE IF EXISTS congestion_events.itsc_issues_locations;
-- DROP TABLE IF EXISTS congestion_events.itsc_issue_locations;

CREATE TABLE IF NOT EXISTS congestion_events.itsc_issues_locations
CREATE TABLE IF NOT EXISTS congestion_events.itsc_issue_locations
(
divisionid smallint NOT NULL,
issueid integer NOT NULL,
Expand Down Expand Up @@ -30,13 +30,13 @@ CREATE TABLE IF NOT EXISTS congestion_events.itsc_issues_locations

TABLESPACE pg_default;

ALTER TABLE IF EXISTS congestion_events.itsc_issues_locations OWNER TO dbadmin;
ALTER TABLE IF EXISTS congestion_events.itsc_issue_locations OWNER TO dbadmin;

REVOKE ALL ON TABLE congestion_events.itsc_issues_locations FROM bdit_humans;
GRANT SELECT ON TABLE congestion_events.itsc_issues_locations TO bdit_humans;
REVOKE ALL ON TABLE congestion_events.itsc_issue_locations FROM bdit_humans;
GRANT SELECT ON TABLE congestion_events.itsc_issue_locations TO bdit_humans;

GRANT ALL ON TABLE congestion_events.itsc_issues_locations TO dbadmin;
GRANT ALL ON TABLE congestion_events.itsc_issue_locations TO dbadmin;

GRANT ALL ON TABLE congestion_events.itsc_issues_locations TO rds_superuser WITH GRANT OPTION;
GRANT ALL ON TABLE congestion_events.itsc_issue_locations TO rds_superuser WITH GRANT OPTION;

GRANT ALL ON TABLE congestion_events.itsc_issues_locations TO vds_bot;
GRANT ALL ON TABLE congestion_events.itsc_issue_locations TO vds_bot;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--this redundant CTE is just to apply ST_GeomFromText to geom_text.
TRUNCATE congestion_events.itsc_issue_locations;
WITH locations (
divisionid, issueid, timestamputc, locationindex, mainroadname, fromroadname,
toroadname, direction_toplevel, lanesaffected, streetnumber, locationtype, groupid,
Expand All @@ -10,7 +11,7 @@ WITH locations (
VALUES %s
)

INSERT INTO congestion_events.itsc_issues_locations (
INSERT INTO congestion_events.itsc_issue_locations (
divisionid, issueid, timestamputc, locationindex, mainroadname, fromroadname, toroadname,
direction_toplevel, streetnumber, locationtype, groupid, groupdescription, lanesaffected,
locationblocklevel_toplevel, roadclosuretype_toplevel, encodedcoordinates_toplevel,
Expand Down

0 comments on commit 95a124c

Please sign in to comment.