aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-12-22 12:35:19 +0300
committerGravatar Vitaly Takmazov2017-12-22 12:35:19 +0300
commita28f045836c1f0cadbbfcbaf85cb03b7ed643039 (patch)
tree7c6e86757e53b1abb39a804e2bdc3491a84ad154 /juick-server-jdbc/src/main
parent8c95c51f0bc226a2ec277d54154760898ccd6f32 (diff)
jdbc: write last reply time to message
Diffstat (limited to 'juick-server-jdbc/src/main')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
index 721bfb4e..f579577f 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -190,7 +190,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
if (ridnew > 0)
getJdbcTemplate().update(
- "UPDATE messages SET replies = replies + 1 WHERE message_id = ?",
+ "UPDATE messages, (SELECT ts FROM replies) as r " +
+ "SET messages.replies = messages.replies + 1, messages.updated = r.ts WHERE message_id = ?",
mid);
return ridnew;
}