mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-04 14:03:24 +01:00
Fix typo
This commit is contained in:
parent
3d5f29c1f6
commit
15950f3d04
@ -36,7 +36,7 @@ public MySQL(@NotNull Minepacks plugin, @Nullable ConnectionProvider connectionP
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateQuerysForDialect()
|
protected void updateQueriesForDialect()
|
||||||
{
|
{
|
||||||
queryDeleteOldBackpacks = "DELETE FROM `{TableBackpacks}` WHERE `{FieldBPLastUpdate}` + INTERVAL {VarMaxAge} day < NOW()";
|
queryDeleteOldBackpacks = "DELETE FROM `{TableBackpacks}` WHERE `{FieldBPLastUpdate}` + INTERVAL {VarMaxAge} day < NOW()";
|
||||||
queryUpdateBp = queryUpdateBp.replaceAll("\\{NOW}", "NOW()");
|
queryUpdateBp = queryUpdateBp.replaceAll("\\{NOW}", "NOW()");
|
||||||
|
@ -56,7 +56,7 @@ public SQL(@NotNull Minepacks plugin, @NotNull ConnectionProvider connectionProv
|
|||||||
if(!dataSource.isAvailable()) throw new IllegalStateException("Failed to initialize database connection!");
|
if(!dataSource.isAvailable()) throw new IllegalStateException("Failed to initialize database connection!");
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
buildQuerys();
|
buildQueries();
|
||||||
checkDB();
|
checkDB();
|
||||||
checkUUIDs(); // Check if there are user accounts without UUID
|
checkUUIDs(); // Check if there are user accounts without UUID
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ public Connection getConnection() throws SQLException
|
|||||||
|
|
||||||
protected abstract void checkDB();
|
protected abstract void checkDB();
|
||||||
|
|
||||||
protected final void buildQuerys()
|
protected final void buildQueries()
|
||||||
{
|
{
|
||||||
// Build the SQL querys with placeholders for the table and field names
|
// Build the SQL querys with placeholders for the table and field names
|
||||||
queryGetBP = "SELECT {FieldBPOwner},{FieldBPITS},{FieldBPVersion} FROM {TableBackpacks} INNER JOIN {TablePlayers} ON {TableBackpacks}.{FieldBPOwner}={TablePlayers}.{FieldPlayerID} WHERE {FieldUUID}=?;";
|
queryGetBP = "SELECT {FieldBPOwner},{FieldBPITS},{FieldBPVersion} FROM {TableBackpacks} INNER JOIN {TablePlayers} ON {TableBackpacks}.{FieldBPOwner}={TablePlayers}.{FieldPlayerID} WHERE {FieldUUID}=?;";
|
||||||
@ -203,7 +203,7 @@ protected final void buildQuerys()
|
|||||||
queryFixUUIDs = "UPDATE {TablePlayers} SET {FieldUUID}=? WHERE {FieldPlayerID}=?;";
|
queryFixUUIDs = "UPDATE {TablePlayers} SET {FieldUUID}=? WHERE {FieldPlayerID}=?;";
|
||||||
queryDeleteOldCooldowns = "DELETE FROM {TableCooldowns} WHERE {FieldCDTime}<?;";
|
queryDeleteOldCooldowns = "DELETE FROM {TableCooldowns} WHERE {FieldCDTime}<?;";
|
||||||
|
|
||||||
updateQuerysForDialect();
|
updateQueriesForDialect();
|
||||||
|
|
||||||
setTableAndFieldNames();
|
setTableAndFieldNames();
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ protected void setTableAndFieldNames()
|
|||||||
queryDeleteOldCooldowns = replacePlaceholders(queryDeleteOldCooldowns);
|
queryDeleteOldCooldowns = replacePlaceholders(queryDeleteOldCooldowns);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void updateQuerysForDialect();
|
protected abstract void updateQueriesForDialect();
|
||||||
|
|
||||||
protected String replacePlaceholders(@Language("SQL") String query)
|
protected String replacePlaceholders(@Language("SQL") String query)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ protected void loadSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateQuerysForDialect()
|
protected void updateQueriesForDialect()
|
||||||
{
|
{
|
||||||
queryInsertBp = queryInsertBp.replaceAll("\\) VALUES \\(\\?,\\?,\\?", ",{FieldBPLastUpdate}) VALUES (?,?,?,DATE('now')");
|
queryInsertBp = queryInsertBp.replaceAll("\\) VALUES \\(\\?,\\?,\\?", ",{FieldBPLastUpdate}) VALUES (?,?,?,DATE('now')");
|
||||||
queryDeleteOldBackpacks = "DELETE FROM {TableBackpacks} WHERE {FieldBPLastUpdate} < DATE('now', '-{VarMaxAge} days')";
|
queryDeleteOldBackpacks = "DELETE FROM {TableBackpacks} WHERE {FieldBPLastUpdate} < DATE('now', '-{VarMaxAge} days')";
|
||||||
|
Loading…
Reference in New Issue
Block a user