-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proxy the organization table for reporting
- Loading branch information
Jon Betts
committed
Jul 6, 2023
1 parent
4fb531f
commit ae4aac7
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
lms/data_tasks/report/create_from_scratch/98_proxies/01_organizations.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); |
2 changes: 2 additions & 0 deletions
2
lms/data_tasks/report/create_from_scratch/98_proxies/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters