Fix owner deletion by qualifying ambiguous tenant_id column
The CountActiveOwnerByOrganizationID query joins iam_membership_profiles with iam_memberships, but used an unqualified tenant_id = @tenant_id in the WHERE clause. Since both tables have a tenant_id column, PostgreSQL raised an "ambiguous column" error when deleting an owner. Fixed by prefixing with the table alias (p.tenant_id) to match the pattern used in CountByOrganizationID. Added TestUser_RemoveOwner e2e test to verify one owner can remove another. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -1121,7 +1121,7 @@ FROM
|
||||
iam_membership_profiles p
|
||||
INNER JOIN iam_memberships m ON m.identity_id = p.identity_id AND m.organization_id = p.organization_id
|
||||
WHERE
|
||||
%s
|
||||
p.%s
|
||||
AND p.organization_id = @organization_id
|
||||
AND p.state = @state
|
||||
AND m.role = @role
|
||||
|
||||
Reference in New Issue
Block a user