reformat insert into server_info for readability
Use the new format capabilities on SQL queries to make the insert more
readable.
(cherry picked from commit 7f06aa7511)
This commit is contained in:
parent
c434f3c6e4
commit
41732cbcd1
|
|
@ -112,12 +112,28 @@ public class PlayerSync {
|
||||||
");"
|
");"
|
||||||
);
|
);
|
||||||
long current = System.currentTimeMillis();
|
long current = System.currentTimeMillis();
|
||||||
JDBCsetUp.executeUpdate(
|
JDBCsetUp.executeUpdate("""
|
||||||
"INSERT INTO " + dbName + ".server_info(id,enable,last_update) " +
|
INSERT INTO %s.server_info
|
||||||
"VALUES(" + JdbcConfig.SERVER_ID.get() + ",true," + current + ") " +
|
(
|
||||||
"ON DUPLICATE KEY UPDATE id= " + JdbcConfig.SERVER_ID.get() + ",enable = 1," +
|
id,
|
||||||
"last_update=" + current + ";"
|
enable,
|
||||||
);
|
last_update
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
%d,
|
||||||
|
true,
|
||||||
|
%d
|
||||||
|
)
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
id = %d,
|
||||||
|
enable = true,
|
||||||
|
last_update = %d;
|
||||||
|
""",
|
||||||
|
dbName,
|
||||||
|
JdbcConfig.SERVER_ID.get(),
|
||||||
|
current,
|
||||||
|
JdbcConfig.SERVER_ID.get(),
|
||||||
|
current);
|
||||||
|
|
||||||
// Create curios table if the Curios mod is loaded
|
// Create curios table if the Curios mod is loaded
|
||||||
if (ModList.get().isLoaded("curios")) {
|
if (ModList.get().isLoaded("curios")) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user