Skip to content

Commit

Permalink
Merge pull request #1525 from bersace/env
Browse files Browse the repository at this point in the history
Query notify contacts using envs
  • Loading branch information
bersace authored Oct 18, 2024
2 parents 253d944 + 907463f commit ca80c07
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
SELECT
array_agg(DISTINCT r.role_email) FILTER (WHERE r.role_email IS NOT NULL AND r.role_email <> '') AS emails,
array_agg(DISTINCT r.role_phone) FILTER (WHERE r.role_phone IS NOT NULL AND r.role_phone <> '') AS phones
FROM application.instance_groups AS ixg
JOIN application.access_role_instance AS ari
ON ari.instance_group_name = ixg.group_name AND ari.instance_group_kind = ixg.group_kind
JOIN application.role_groups AS rxg
ON rxg.group_name = ari.role_group_name AND rxg.group_kind = ari.role_group_kind
JOIN application.roles AS r
ON r.role_name = rxg.role_name
WHERE ixg.agent_address = :agent_address AND ixg.agent_port = :agent_port
AND r.is_active;
FROM application.instances AS i
JOIN application.environments AS e ON i.environment_id = e.id
JOIN application.memberships AS m ON e.dba_group_id = m.group_id
JOIN application.roles AS r ON m.role_name = r.role_name
WHERE i.agent_address = :agent_address AND i.agent_port = :agent_port
AND r.is_active AND i.notify;

0 comments on commit ca80c07

Please sign in to comment.