Fix Database upgrader not upgrading the databsae

This commit is contained in:
William committed 2021-07-20 15:11:00 +01:00
1 parent ee846fe05d
commit 9fcc6b32d1
2 files changed
+3 -3

No files matched your search

@@ -930,7 +930,7 @@ public class DataManager {
ps.close();
}
} else {
Bukkit.getLogger().warning("Failed to add a home for a player!");
Bukkit.getLogger().warning("Player ID was null; failed to add a home for a player!");
}
}
@@ -20,8 +20,8 @@ public class UpgradeDatabase {
try (PreparedStatement tableUpdateStatement = HuskHomes.getConnection().prepareStatement(
"ALTER TABLE " + HuskHomes.getSettings().getPlayerDataTable()
+ " ADD `is_ignoring_requests` boolean NOT NULL DEFAULT 0, "
+ "`offline_location_id` integer NULL DEFAULT NULL, "
+ "FOREIGN KEY (`offline_location_id`) REFERENCES " + HuskHomes.getSettings().getLocationsDataTable() + " (`location_id`) ON DELETE SET NULL ON UPDATE NO ACTION;")) {
+ "ADD `offline_location_id` integer NULL DEFAULT NULL, "
+ "ADD FOREIGN KEY (`offline_location_id`) REFERENCES " + HuskHomes.getSettings().getLocationsDataTable() + " (`location_id`) ON DELETE SET NULL ON UPDATE NO ACTION;")) {
tableUpdateStatement.executeUpdate();
plugin.getLogger().info("Database update complete!");
} catch (SQLException e) {