mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
test: add unit test to excercise bug when idp sync hits deleted orgs (#17405)
Deleted organizations are still attempting to sync members. This causes an error on inserting the member, and would likely cause issues later in the sync process even if that member is inserted. Deleted orgs should be skipped.
This commit is contained in:
@ -55,8 +55,13 @@ SELECT
|
||||
FROM
|
||||
organizations
|
||||
WHERE
|
||||
-- Optionally include deleted organizations
|
||||
deleted = @deleted AND
|
||||
-- Optionally provide a filter for deleted organizations.
|
||||
CASE WHEN
|
||||
sqlc.narg('deleted') :: boolean IS NULL THEN
|
||||
true
|
||||
ELSE
|
||||
deleted = sqlc.narg('deleted')
|
||||
END AND
|
||||
id = ANY(
|
||||
SELECT
|
||||
organization_id
|
||||
|
Reference in New Issue
Block a user