From 192fca3a89ab24d6026db47477ee0e27832c39e6 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 7 Apr 2024 19:16:32 +0200 Subject: [PATCH] Fix chat log message deletion query Corrected the SQL query in the `deleteOldMessages` method within `ChatLogQueries.java`. Originally, it was incorrectly deleting newer messages rather than older ones due to an incorrect comparison symbol. It has now been adjusted to properly delete older messages based on the provided duration. --- api/src/main/java/com/alttd/chat/database/ChatLogQueries.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/alttd/chat/database/ChatLogQueries.java b/api/src/main/java/com/alttd/chat/database/ChatLogQueries.java index a9da5d2..1554450 100644 --- a/api/src/main/java/com/alttd/chat/database/ChatLogQueries.java +++ b/api/src/main/java/com/alttd/chat/database/ChatLogQueries.java @@ -82,7 +82,7 @@ public class ChatLogQueries { } public static CompletableFuture deleteOldMessages(Duration duration) { - String query = "DELETE FROM chat_log WHERE time_stamp > ?"; + String query = "DELETE FROM chat_log WHERE time_stamp < ?"; return CompletableFuture.supplyAsync(() -> { try (Connection connection = DatabaseConnection.getConnection()) {