From d60efce81adb8ed831d26343646d36b6dd952249 Mon Sep 17 00:00:00 2001 From: Ilya Andreev Date: Sat, 23 Dec 2023 01:38:29 +0300 Subject: [PATCH] Fix Sqlite createOrUpdate query --- .../chatty/repository/player/SqlitePlayerDataRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spigot/src/main/java/ru/brikster/chatty/repository/player/SqlitePlayerDataRepository.java b/spigot/src/main/java/ru/brikster/chatty/repository/player/SqlitePlayerDataRepository.java index ab872a7..5ee2988 100644 --- a/spigot/src/main/java/ru/brikster/chatty/repository/player/SqlitePlayerDataRepository.java +++ b/spigot/src/main/java/ru/brikster/chatty/repository/player/SqlitePlayerDataRepository.java @@ -117,7 +117,7 @@ public SqlitePlayerDataRepository(Path dataFolder) { public void createOrUpdateUser(@NotNull UUID uuid, @NotNull String username) { try (Connection connection = dataSource.getConnection(); PreparedStatement statement = connection.prepareStatement( - "INSERT INTO users (uuid, username) VALUES (?, ?) ON CONFLICT (uuid, username) DO UPDATE SET username = ?")) { + "INSERT INTO users (uuid, username) VALUES (?, ?) ON CONFLICT (uuid) DO UPDATE SET username = ?")) { statement.setBytes(1, SqliteUtil.fromUUID(uuid)); statement.setString(2, username); statement.setString(3, username);