mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 12:00:21 +00:00
Fix SQL
This commit is contained in:
parent
34fd1f7ab5
commit
803291728c
1 changed files with 3 additions and 3 deletions
|
@ -843,7 +843,7 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
|
||||||
upd.stream_ordering,
|
upd.stream_ordering,
|
||||||
old.user_id
|
old.user_id
|
||||||
FROM (
|
FROM (
|
||||||
SELECT user_id, room_id, count(*) as unread_count,
|
SELECT user_id, room_id, count(*) as %s,
|
||||||
max(stream_ordering) as stream_ordering
|
max(stream_ordering) as stream_ordering
|
||||||
FROM event_push_actions
|
FROM event_push_actions
|
||||||
WHERE ? <= stream_ordering AND stream_ordering < ?
|
WHERE ? <= stream_ordering AND stream_ordering < ?
|
||||||
|
@ -856,14 +856,14 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
|
||||||
|
|
||||||
# First get the count of unread messages.
|
# First get the count of unread messages.
|
||||||
txn.execute(
|
txn.execute(
|
||||||
sql % ("unread_count", "unread_count", ""),
|
sql % ("unread_count", "unread_count", "unread_count", ""),
|
||||||
(old_rotate_stream_ordering, rotate_to_stream_ordering),
|
(old_rotate_stream_ordering, rotate_to_stream_ordering),
|
||||||
)
|
)
|
||||||
rows = txn.fetchall()
|
rows = txn.fetchall()
|
||||||
|
|
||||||
# Then get the count of notifications.
|
# Then get the count of notifications.
|
||||||
txn.execute(
|
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),
|
(old_rotate_stream_ordering, rotate_to_stream_ordering),
|
||||||
)
|
)
|
||||||
notif_rows = txn.fetchall()
|
notif_rows = txn.fetchall()
|
||||||
|
|
Loading…
Reference in a new issue