Wrong database names and columns used

This commit is contained in:
Jesse Wierzbinski 2024-04-11 02:18:46 -10:00
parent df939a6a7a
commit 6263c667e8
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -72,7 +72,7 @@ export default apiRoute<{
since_id ? gte(status.id, since_id) : undefined,
min_id ? gt(status.id, min_id) : undefined,
eq(status.authorId, id),
sql`EXISTS (SELECT 1 FROM _UserPinnedNotes WHERE _UserPinnedNotes.status_id = ${status.id} AND _UserPinnedNotes.user_id = ${user.id})`,
sql`EXISTS (SELECT 1 FROM "_UserPinnedNotes" WHERE "_UserPinnedNotes"."A" = ${status.id} AND "_UserPinnedNotes"."B" = ${user.id})`,
only_media
? sql`EXISTS (SELECT 1 FROM "Attachment" WHERE "Attachment"."statusId" = ${status.id})`
: undefined,

View file

@ -67,7 +67,7 @@ export default apiRoute<{
), */
// All statuses where the user is mentioned, using table _StatusToUser which has a: status.id and b: user.id
// WHERE format (... = ...)
sql`EXISTS (SELECT 1 FROM "_StatusToUser" WHERE "_StatusToUser"."a" = ${status.id} AND "_StatusToUser"."b" = ${user.id})`,
sql`EXISTS (SELECT 1 FROM "_StatusToUser" WHERE "_StatusToUser"."A" = ${status.id} AND "_StatusToUser"."B" = ${user.id})`,
// All statuses from users that the user is following
// WHERE format (... = ...)
sql`EXISTS (SELECT 1 FROM "Relationship" WHERE "Relationship"."subjectId" = ${status.authorId} AND "Relationship"."ownerId" = ${user.id} AND "Relationship"."following" = true)`,