From 86f3687d6a9534b77ccb0e4c718cd5b7dd3c22da Mon Sep 17 00:00:00 2001 From: Krakenied Date: Sat, 16 Nov 2024 03:06:42 +0100 Subject: [PATCH] Fix database migrator Use next() instead of first() on TYPE_FORWARD_ONLY set --- .../quests/bukkit/storage/ModernMySQLStorageProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/storage/ModernMySQLStorageProvider.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/storage/ModernMySQLStorageProvider.java index df1f3a18..622b3ed4 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/storage/ModernMySQLStorageProvider.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/storage/ModernMySQLStorageProvider.java @@ -534,7 +534,7 @@ public int getInitialSchemaVersion() throws SQLException { try (final Statement stmt = this.conn.createStatement(); final ResultSet rs = stmt.executeQuery(this.prefixer.apply(GET_STARTED_DATE_COLUMN))) { - if (rs.first()) { + if (rs.next()) { return LATEST_SCHEMA_VERSION; } else { return 1; @@ -548,7 +548,7 @@ public int getCurrentSchemaVersion() throws SQLException { try (final Statement stmt = this.conn.createStatement(); final ResultSet rs = stmt.executeQuery(this.prefixer.apply(SELECT_SCHEMA_VERSION))) { - if (rs.first()) { + if (rs.next()) { final int version = Integer.parseUnsignedInt(rs.getString(1)); this.plugin.getQuestsLogger().debug("Current schema version: " + version + "."); return version;