Skip to content

Commit

Permalink
Make database upgrader execute
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Jul 21, 2021
1 parent 9fcc6b3 commit 74fd90c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class UpgradeDatabase {
// Upgrade the database system if the config file version is not high enough
public static void upgradeDatabase() {
plugin.reloadConfig();
if (plugin.getConfig().getInt("config_file_version", 1) <= 5) {
plugin.getLogger().info("Detected that the database needs updating. Running database upgrade...");
if (plugin.getConfig().getInt("config_file_version", 1) <= 6) {
plugin.getLogger().info("Detected that the database might need updating. Running database upgrade...");
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try (PreparedStatement tableUpdateStatement = HuskHomes.getConnection().prepareStatement(
"ALTER TABLE " + HuskHomes.getSettings().getPlayerDataTable()
Expand All @@ -29,7 +29,7 @@ public static void upgradeDatabase() {
} finally {
// Update the config file version
Bukkit.getScheduler().runTask(plugin, () -> {
plugin.getConfig().set("config_file_version", 6);
plugin.getConfig().set("config_file_version", 7);
plugin.saveConfig();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ economy_integration:
random_teleport: 20
back: 0
handle_vanished_players: true
config_file_version: 6
config_file_version: 7

0 comments on commit 74fd90c

Please sign in to comment.