mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Wrong database names and columns used
This commit is contained in:
parent
df939a6a7a
commit
6263c667e8
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue