Skip to content

Commit

Permalink
Proxy the organization table for reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Betts committed Jul 6, 2023
1 parent 4fb531f commit ae4aac7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DROP VIEW IF EXISTS report.organizations CASCADE;

-- Create a proxy view to isolate LMS from reading our data directly
CREATE VIEW report.organizations AS (
SELECT
id,
public_id,
name,
created,
updated,
enabled
FROM organization
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
These views proxy tables so that LMS doesn't read directly from our main
tables. This allows us to change slowly without breaking LMS should we need to.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
GRANT SELECT ON report.group_bubbled_activity TO "{{fdw_user}}";
GRANT SELECT ON report.group_bubbled_counts TO "{{fdw_user}}";
GRANT SELECT ON report.group_roles TO "{{fdw_user}}";
GRANT SELECT ON report.organizations TO "{{fdw_user}}";
GRANT SELECT ON report.organization_activity TO "{{fdw_user}}";
GRANT SELECT ON report.organization_annotation_counts TO "{{fdw_user}}";
GRANT SELECT ON report.organization_assignments TO "{{fdw_user}}";
Expand Down

0 comments on commit ae4aac7

Please sign in to comment.