break out user subscriptions

This commit is contained in:
keyan 2023-08-29 14:38:00 -05:00
parent 0d4a225442
commit 58c1980786

View File

@ -91,9 +91,12 @@ export default {
AND "Item"."userId" <> $1 AND "Item".created_at <= $2 AND "Item"."userId" <> $1 AND "Item".created_at <= $2
${await filterClause(me, models)} ${await filterClause(me, models)}
ORDER BY "sortTime" DESC ORDER BY "sortTime" DESC
LIMIT ${LIMIT}+$3) LIMIT ${LIMIT}+$3)`
UNION DISTINCT
(SELECT DISTINCT "Item".id::TEXT, "Item".created_at AS "sortTime", NULL::BIGINT as "earnedSats", )
queries.push(
`(SELECT DISTINCT "Item".id::TEXT, "Item".created_at AS "sortTime", NULL::BIGINT as "earnedSats",
'FollowActivity' AS type 'FollowActivity' AS type
FROM "Item" FROM "Item"
JOIN "UserSubscription" ON "Item"."userId" = "UserSubscription"."followeeId" JOIN "UserSubscription" ON "Item"."userId" = "UserSubscription"."followeeId"