Skip to content

Commit

Permalink
fix: version_uuid instead of id in PSQL rotateSnapshots
Browse files Browse the repository at this point in the history
(cherry picked from commit cabde9e)
  • Loading branch information
WiIIiam278 committed Sep 29, 2024
1 parent cf199fb commit 841611f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ protected void rotateSnapshots(@NotNull User user) {
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
ORDER BY timestamp ASC
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();
Expand Down

0 comments on commit 841611f

Please sign in to comment.