-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1099 from guardian/aa/prisma-introspection
fix(prisma): Updates after introspection
- Loading branch information
Showing
6 changed files
with
89 additions
and
457 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
SELECT | ||
DISTINCT acc.id, | ||
acc.name, | ||
acc.email, | ||
acc.status, | ||
acc.joined_timestamp, | ||
COALESCE(ou.name, 'ROOT' :: text) AS organizational_unit | ||
fn_aws_accounts.id, | ||
fn_aws_accounts.name, | ||
fn_aws_accounts.email, | ||
fn_aws_accounts.status, | ||
fn_aws_accounts.joined_timestamp, | ||
fn_aws_accounts.organizational_unit | ||
FROM | ||
( | ||
( | ||
aws_organizations_accounts acc | ||
LEFT JOIN aws_organizations_account_parents par ON ((acc.id = par.id)) | ||
) | ||
LEFT JOIN aws_organizations_organizational_units ou ON ((par.parent_id = ou.id)) | ||
fn_aws_accounts() fn_aws_accounts( | ||
id, | ||
name, | ||
email, | ||
STATUS, | ||
joined_timestamp, | ||
organizational_unit | ||
); |
320 changes: 0 additions & 320 deletions
320
packages/common/prisma/views/public/view_aws_resources.sql
This file was deleted.
Oops, something went wrong.
37 changes: 15 additions & 22 deletions
37
packages/common/prisma/views/public/view_github_actions.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 |
---|---|---|
@@ -1,25 +1,18 @@ | ||
WITH data AS ( | ||
SELECT | ||
tbl.evaluated_on, | ||
tbl.full_name, | ||
tbl.workflow_path, | ||
use_string.use_string AS ACTION, | ||
split_part(use_string.use_string, '@' :: text, 1) AS action_name, | ||
split_part(use_string.use_string, '@' :: text, '-1' :: integer) AS version | ||
FROM | ||
guardian_github_actions_usage tbl, | ||
LATERAL unnest(tbl.workflow_uses) use_string(use_string) | ||
) | ||
SELECT | ||
d.evaluated_on, | ||
d.full_name, | ||
r.archived, | ||
d.workflow_path, | ||
d.action, | ||
d.action_name, | ||
d.version | ||
fn_github_actions.evaluated_on, | ||
fn_github_actions.full_name, | ||
fn_github_actions.archived, | ||
fn_github_actions.workflow_path, | ||
fn_github_actions.action, | ||
fn_github_actions.action_name, | ||
fn_github_actions.version | ||
FROM | ||
( | ||
data d | ||
JOIN github_repositories r ON ((d.full_name = r.full_name)) | ||
fn_github_actions() fn_github_actions( | ||
evaluated_on, | ||
full_name, | ||
archived, | ||
workflow_path, | ||
ACTION, | ||
action_name, | ||
version | ||
); |
Oops, something went wrong.