perf: 优化消息缓存表格
This commit is contained in:
@@ -140,7 +140,10 @@ public abstract class BallAPI {
|
||||
") CHARSET utf8mb4;");
|
||||
statement.execute("CREATE TABLE IF NOT EXISTS `hamster_ball_cached_message`(" +
|
||||
"`uuid` CHAR(36) NOT NULL," +
|
||||
"`message` TEXT NOT NULL" +
|
||||
"`message` TEXT NOT NULL," +
|
||||
"`time` DATETIME NOT NULL DEFAULT NOW()," +
|
||||
"INDEX `idx_uuid` USING BTREE (`uuid`)," +
|
||||
"INDEX `idx_time` USING BTREE (`time`)" +
|
||||
") CHARSET utf8mb4;");
|
||||
}
|
||||
if (getBallConfig().isGameServerUpdatePlayerInfo()) {
|
||||
@@ -329,7 +332,7 @@ public abstract class BallAPI {
|
||||
}
|
||||
try (Connection connection = getDatasource().getConnection()) {
|
||||
try (PreparedStatement statement = connection.prepareStatement(
|
||||
"INSERT INTO `hamster_ball_cached_message` VALUES(?, ?);"
|
||||
"INSERT INTO `hamster_ball_cached_message` VALUES(?, ?, DEFAULT);"
|
||||
)) {
|
||||
statement.setString(1, receiver.toString());
|
||||
statement.setString(2, message.toJson().toString());
|
||||
|
Reference in New Issue
Block a user