SELECT *
FROM "user_organization"
INNER JOIN "Organization"
ON "user_organization"."organizationId" = "Organization"."id"
WHERE ("user_organization"."deletedAt" IS NULL OR "user_organization"."deletedAt" > ($1)) AND "user_organization"."userId" = ($2)
ORDER BY "Organization"."createdAt" DESC
LIMIT 1 OFFSET 5
Organization had to manually be added in .filter(\Organization.deletedAt == nil) to not return deleted organizations :)
Hi Tanner
Wrote this query last night:
It returns:
Organization had to manually be added in
.filter(\Organization.deletedAt == nil)
to not return deleted organizations :)