1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 12:05:16 +01:00

Fixed issue when converted the database and the "truncate" is removed in latest sqlite

- Also fixed issue when converted then the player data not show to player
This commit is contained in:
montlikadani 2019-07-12 18:29:00 +02:00
parent 34dcb3d41a
commit 1f85c13335
3 changed files with 4 additions and 3 deletions

View File

@ -53,7 +53,6 @@ public class convert implements Cmd {
Jobs.getJobsDAO().saveExplore();
Jobs.getJobsDAO().saveBlockProtection();
Jobs.loadAllPlayersData();
} catch (SQLException e) {
e.printStackTrace();
Jobs.consoleMsg("&cCan't write data to data base, please send error log to dev's.");
@ -62,6 +61,8 @@ public class convert implements Cmd {
try {
Jobs.reload();
Jobs.loadAllPlayersData();
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -1035,7 +1035,7 @@ public abstract class JobsDAO {
try {
statement = conns.createStatement();
if (Jobs.getDBManager().getDbType().toString().equalsIgnoreCase("sqlite")) {
statement.executeUpdate("TRUNCATE TABLE `" + getPrefix() + table + "`");
statement.executeUpdate("DELETE from `" + getPrefix() + table + "`");
} else {
statement.executeUpdate("DELETE from `" + getPrefix() + table + "`");
}

View File

@ -47,7 +47,7 @@ public class JobsManager {
File f = new File(Jobs.getFolder(), "generalConfig.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
config.set("storage.method", DbType.toString());
config.set("storage.method", DbType.toString().toLowerCase());
try {
config.save(f);
} catch (IOException e) {