Fix column reference "full_name" is ambiguous

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-02-04 18:46:44 +01:00
parent c75fe62641
commit 65aea6ea11

View File

@@ -450,8 +450,9 @@ WITH mbr AS (
identity_id = @identity_id identity_id = @identity_id
AND state = 'ACTIVE' AND state = 'ACTIVE'
AND %s AND %s
) ),
SELECT r AS (
SELECT
mbr.id, mbr.id,
mbr.identity_id, mbr.identity_id,
mbr.organization_id, mbr.organization_id,
@@ -463,14 +464,29 @@ SELECT
o.name as organization_name, o.name as organization_name,
mbr.created_at, mbr.created_at,
mbr.updated_at mbr.updated_at
FROM FROM
mbr mbr
JOIN JOIN
identities i ON mbr.identity_id = i.id identities i ON mbr.identity_id = i.id
JOIN JOIN
organizations o ON mbr.organization_id = o.id organizations o ON mbr.organization_id = o.id
LEFT JOIN LEFT JOIN
iam_membership_profiles mp ON mp.membership_id = mbr.id iam_membership_profiles mp ON mp.membership_id = mbr.id
)
SELECT
id,
identity_id,
organization_id,
role,
source,
state,
full_name,
email_address,
organization_name,
created_at,
updated_at
FROM
r
WHERE WHERE
%s %s
` `
@@ -521,8 +537,9 @@ WITH m AS (
WHERE WHERE
organization_id = @organization_id organization_id = @organization_id
AND %s AND %s
) ),
SELECT r AS (
SELECT
m.id, m.id,
m.identity_id, m.identity_id,
m.organization_id, m.organization_id,
@@ -534,17 +551,33 @@ SELECT
i.email_address, i.email_address,
m.created_at, m.created_at,
m.updated_at m.updated_at
FROM FROM
m m
JOIN JOIN
identities i ON m.identity_id = i.id identities i ON m.identity_id = i.id
JOIN JOIN
organizations o ON m.organization_id = o.id organizations o ON m.organization_id = o.id
LEFT JOIN LEFT JOIN
iam_membership_profiles mp ON mp.membership_id = m.id iam_membership_profiles mp ON mp.membership_id = m.id
WHERE
%s
)
SELECT
id,
identity_id,
organization_id,
role,
source,
state,
full_name,
organization_name,
email_address,
created_at,
updated_at
FROM
r
WHERE WHERE
%s %s
AND %s
` `
query = fmt.Sprintf(query, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment()) query = fmt.Sprintf(query, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())