fix: message cursor direction

closes: #39
This commit is contained in:
Enot (ded) Skelly
2026-06-06 11:21:12 -07:00
parent c792029d3d
commit cbf2c0bc5f
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -618,7 +618,7 @@ WHERE cm.channel_id = $1
AND ($2::timestamptz IS NULL OR cm.sent_at >= $2)
AND ($3::text = '' OR po.iata = ANY(string_to_array($3::text, ',')))
AND ($4::text = '' OR ts.name = $4::text)
AND ($5::bigint = 0 OR cm.id > $5::bigint)
AND ($5::bigint = 0 OR cm.id < $5::bigint)
ORDER BY cm.id DESC
LIMIT $6;
@@ -636,7 +636,7 @@ LEFT JOIN transport_scopes ts ON ts.id = p.scope_id
WHERE ($1::timestamptz IS NULL OR cm.sent_at >= $1)
AND ($2::text = '' OR po.iata = ANY(string_to_array($2::text, ',')))
AND ($3::text = '' OR ts.name = $3::text)
AND ($4 = 0 OR cm.id > $4)
AND ($4 = 0 OR cm.id < $4)
ORDER BY cm.id DESC
LIMIT $5;
@@ -656,7 +656,7 @@ WHERE c.channel_hash = $1
AND ($2::timestamptz IS NULL OR cm.sent_at >= $2)
AND ($3::text = '' OR po.iata = ANY(string_to_array($3::text, ',')))
AND ($4::text = '' OR ts.name = $4::text)
AND ($5::bigint = 0 OR cm.id > $5::bigint)
AND ($5::bigint = 0 OR cm.id < $5::bigint)
ORDER BY cm.id DESC
LIMIT $6;
+3 -3
View File
@@ -1395,7 +1395,7 @@ LEFT JOIN transport_scopes ts ON ts.id = p.scope_id
WHERE ($1::timestamptz IS NULL OR cm.sent_at >= $1)
AND ($2::text = '' OR po.iata = ANY(string_to_array($2::text, ',')))
AND ($3::text = '' OR ts.name = $3::text)
AND ($4 = 0 OR cm.id > $4)
AND ($4 = 0 OR cm.id < $4)
ORDER BY cm.id DESC
LIMIT $5
`
@@ -1473,7 +1473,7 @@ WHERE cm.channel_id = $1
AND ($2::timestamptz IS NULL OR cm.sent_at >= $2)
AND ($3::text = '' OR po.iata = ANY(string_to_array($3::text, ',')))
AND ($4::text = '' OR ts.name = $4::text)
AND ($5::bigint = 0 OR cm.id > $5::bigint)
AND ($5::bigint = 0 OR cm.id < $5::bigint)
ORDER BY cm.id DESC
LIMIT $6
`
@@ -1554,7 +1554,7 @@ WHERE c.channel_hash = $1
AND ($2::timestamptz IS NULL OR cm.sent_at >= $2)
AND ($3::text = '' OR po.iata = ANY(string_to_array($3::text, ',')))
AND ($4::text = '' OR ts.name = $4::text)
AND ($5::bigint = 0 OR cm.id > $5::bigint)
AND ($5::bigint = 0 OR cm.id < $5::bigint)
ORDER BY cm.id DESC
LIMIT $6
`