Port the previous PostgreSQL improvements to SQLite3.
[quassel.git] / src / core / SQL / PostgreSQL / 20 / update_buffer_lastseen.sql
index 5541505..98218a6 100644 (file)
@@ -1,3 +1,3 @@
 UPDATE buffer
-SET lastseenmsgid = :lastseenmsgid
+SET lastseenmsgid = min(:lastseenmsgid, buffer.lastmsgid)
 WHERE userid = :userid AND bufferid = :bufferid