Skip to content

Commit

Permalink
#868, #879 fluff
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Jul 26, 2024
1 parent ee32b41 commit e62098b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ OWNER TO miovision_admins;
GRANT EXECUTE ON FUNCTION miovision_api.aggregate_15_min_mvt(date, date, integer [])
TO miovision_api_bot;

COMMENT ON FUNCTION miovision_api.aggregate_15_min_mvt(date, date, integer [])
COMMENT ON FUNCTION miovision_api.aggregate_15_min_mvt(date, date, integer [])
IS '''Aggregates valid movements from `miovision_api.volumes` in to
`miovision_api.volumes_15min_mvt_unfiltered` as 15 minute turning movement counts (TMC) bins and fills
in gaps with 0-volume bins. Also updates foreign key in `miovision_api.volumes`. Takes an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ GRANT EXECUTE ON FUNCTION miovision_api.clear_15_min_mvt(timestamp, timestamp, i
TO miovision_admins;

COMMENT ON FUNCTION miovision_api.clear_15_min_mvt(timestamp, timestamp, integer [])
IS '''Clears data from `miovision_api.volumes_15min_mvt_unfiltered` in order to facilitate re-pulling.
`intersections` param defaults to all intersections.''';
IS '''Clears data from `miovision_api.volumes_15min_mvt_unfiltered` in order to facilitate
re-pulling. `intersections` param defaults to all intersections.''';
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CREATE OR REPLACE FUNCTION miovision_api.create_mm_nested_volumes_partitions(
base_table text,
year_ integer,
mm_ integer)
mm_ integer
)
RETURNS void
LANGUAGE 'plpgsql'
SECURITY DEFINER
Expand Down Expand Up @@ -43,8 +44,11 @@ $BODY$;

COMMENT ON FUNCTION miovision_api.create_mm_nested_volumes_partitions(text, integer, integer) IS
'''Create a new month partition under the parent year table `base_table`. Only to be used for
miovision_api `volumes_15min_mvt_unfiltered` table.
Example: `SELECT miovision_api.create_yyyy_volumes_partition(''volumes_15min_mvt_unfiltered'', 2023)`''';
miovision_api `volumes_15min_mvt_unfiltered` table. Example:
`SELECT miovision_api.create_yyyy_volumes_partition(''volumes_15min_mvt_unfiltered'', 2023)`''';

ALTER FUNCTION miovision_api.create_mm_nested_volumes_partitions(text, integer, integer) OWNER TO miovision_admins;
GRANT EXECUTE ON FUNCTION miovision_api.create_mm_nested_volumes_partitions(text, integer, integer) TO miovision_api_bot;
ALTER FUNCTION miovision_api.create_mm_nested_volumes_partitions(text, integer, integer)
OWNER TO miovision_admins;

GRANT EXECUTE ON FUNCTION miovision_api.create_mm_nested_volumes_partitions(text, integer, integer)
TO miovision_api_bot;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CREATE OR REPLACE FUNCTION miovision_api.create_yyyy_volumes_15min_partition(
base_table text,
year_ integer)
year_ integer
)
RETURNS void
LANGUAGE 'plpgsql'
SECURITY DEFINER
Expand Down Expand Up @@ -39,8 +40,11 @@ $BODY$;

COMMENT ON FUNCTION miovision_api.create_yyyy_volumes_15min_partition(text, integer) IS
'''Create a new year partition under the parent table `base_table`. Only to be used for
miovision_api `volumes_15min_mvt_unfiltered` table.
Example: `SELECT miovision_api.create_yyyy_volumes_partition(''volumes_15min_mvt_unfiltered'', 2023)`''';
miovision_api `volumes_15min_mvt_unfiltered` table. Example:
`SELECT miovision_api.create_yyyy_volumes_partition(''volumes_15min_mvt_unfiltered'', 2023)`''';

ALTER FUNCTION miovision_api.create_yyyy_volumes_15min_partition(text, integer) OWNER TO miovision_admins;
GRANT EXECUTE ON FUNCTION miovision_api.create_yyyy_volumes_15min_partition(text, integer) TO miovision_api_bot;
ALTER FUNCTION miovision_api.create_yyyy_volumes_15min_partition(text, integer)
OWNER TO miovision_admins;

GRANT EXECUTE ON FUNCTION miovision_api.create_yyyy_volumes_15min_partition(text, integer)
TO miovision_api_bot;
5 changes: 3 additions & 2 deletions volumes/miovision/sql/views/create-view-volumes_15min_tmc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ IS 'miovision_api.volumes_15min_mvt_filtered, but only including turning movemen

GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO bdit_humans;
GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO bdit_bots;
GRANT TRIGGER, REFERENCES, SELECT ON TABLE miovision_api.volumes_15min_tmc TO bdit_humans WITH GRANT OPTION;
GRANT TRIGGER, REFERENCES, SELECT ON TABLE miovision_api.volumes_15min_tmc
TO bdit_humans WITH GRANT OPTION;
GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO dbadmin;
GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO miovision_admins;
GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO rds_superuser WITH GRANT OPTION;
GRANT ALL ON TABLE miovision_api.volumes_15min_tmc TO rds_superuser WITH GRANT OPTION;

0 comments on commit e62098b

Please sign in to comment.