mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-21 07:49:13 +00:00
fix: version_uuid instead of id in PSQL rotateSnapshots
This commit is contained in:
@@ -329,7 +329,7 @@ public class PostgresDatabase extends Database {
|
|||||||
try (Connection connection = getConnection()) {
|
try (Connection connection = getConnection()) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
|
try (PreparedStatement statement = connection.prepareStatement(formatStatementTables("""
|
||||||
WITH cte AS (
|
WITH cte AS (
|
||||||
SELECT id
|
SELECT version_uuid
|
||||||
FROM %user_data_table%
|
FROM %user_data_table%
|
||||||
WHERE player_uuid=?
|
WHERE player_uuid=?
|
||||||
AND pinned=FALSE
|
AND pinned=FALSE
|
||||||
@@ -337,7 +337,7 @@ public class PostgresDatabase extends Database {
|
|||||||
LIMIT %entry_count%
|
LIMIT %entry_count%
|
||||||
)
|
)
|
||||||
DELETE FROM %user_data_table%
|
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))))) {
|
Integer.toString(unpinnedUserData.size() - maxSnapshots))))) {
|
||||||
statement.setObject(1, user.getUuid());
|
statement.setObject(1, user.getUuid());
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
|||||||
Reference in New Issue
Block a user