9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00

fix: version_uuid instead of id in PSQL rotateSnapshots

This commit is contained in:
William
2024-09-29 13:35:28 +01:00
parent 4df7d2def4
commit cabde9e8d8

View File

@@ -329,7 +329,7 @@ public class PostgresDatabase extends Database {
try (Connection connection = getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
WITH cte AS (
SELECT id
SELECT version_uuid
FROM %user_data_table%
WHERE player_uuid=?
AND pinned=FALSE
@@ -337,7 +337,7 @@ public class PostgresDatabase extends Database {
LIMIT %entry_count%
)
DELETE FROM %user_data_table%
WHERE id IN (SELECT id FROM cte);""".replace("%entry_count%",
WHERE version_uuid IN (SELECT version_uuid FROM cte);""".replace("%entry_count%",
Integer.toString(unpinnedUserData.size() - maxSnapshots))))) {
statement.setObject(1, user.getUuid());
statement.executeUpdate();