Lets not use sqlite syntax in mysql.

This commit is contained in:
Brianna 2021-09-23 15:47:21 -05:00
parent 841c538c9d
commit bcb298d937

View File

@ -3,6 +3,7 @@ package com.songoda.ultimatestacker.database;
import com.songoda.core.compatibility.CompatibleMaterial; import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.database.DataManagerAbstract; import com.songoda.core.database.DataManagerAbstract;
import com.songoda.core.database.DatabaseConnector; import com.songoda.core.database.DatabaseConnector;
import com.songoda.core.database.SQLiteConnector;
import com.songoda.ultimatestacker.settings.Settings; import com.songoda.ultimatestacker.settings.Settings;
import com.songoda.ultimatestacker.stackable.block.BlockStack; import com.songoda.ultimatestacker.stackable.block.BlockStack;
import com.songoda.ultimatestacker.stackable.entity.ColdEntityStack; import com.songoda.ultimatestacker.stackable.entity.ColdEntityStack;
@ -230,6 +231,7 @@ public class DataManager extends DataManagerAbstract {
Map<Integer, ColdEntityStack> entities = new HashMap<>(); Map<Integer, ColdEntityStack> entities = new HashMap<>();
if (this.databaseConnector instanceof SQLiteConnector) {
String selectOldEntities = "SELECT * FROM " + this.getTablePrefix() + "host_entities where updated_at <= date('now','-" + Settings.DATABASE_PURGE.getInt() + " day')"; String selectOldEntities = "SELECT * FROM " + this.getTablePrefix() + "host_entities where updated_at <= date('now','-" + Settings.DATABASE_PURGE.getInt() + " day')";
try (Statement statement = connection.createStatement()) { try (Statement statement = connection.createStatement()) {
List<String> toDelete = new ArrayList<>(); List<String> toDelete = new ArrayList<>();
@ -244,6 +246,7 @@ public class DataManager extends DataManagerAbstract {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
}
String selectEntities = "SELECT * FROM " + this.getTablePrefix() + "host_entities"; String selectEntities = "SELECT * FROM " + this.getTablePrefix() + "host_entities";