Skip to content
Snippets Groups Projects
Unverified Commit 80329172 authored by Brendan Abolivier's avatar Brendan Abolivier
Browse files

Fix SQL

parent 34fd1f7a
No related branches found
No related tags found
No related merge requests found
......@@ -843,7 +843,7 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
upd.stream_ordering,
old.user_id
FROM (
SELECT user_id, room_id, count(*) as unread_count,
SELECT user_id, room_id, count(*) as %s,
max(stream_ordering) as stream_ordering
FROM event_push_actions
WHERE ? <= stream_ordering AND stream_ordering < ?
......@@ -856,14 +856,14 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
# First get the count of unread messages.
txn.execute(
sql % ("unread_count", "unread_count", ""),
sql % ("unread_count", "unread_count", "unread_count", ""),
(old_rotate_stream_ordering, rotate_to_stream_ordering),
)
rows = txn.fetchall()
# Then get the count of notifications.
txn.execute(
sql % ("notify_count", "notify_count", "notif = 1"),
sql % ("notif_count", "notif_count", "notif_count", "AND notif = 1"),
(old_rotate_stream_ordering, rotate_to_stream_ordering),
)
notif_rows = txn.fetchall()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment