mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-29 12:37:40 +01:00
H2 user and pass field. Deprecated warning.
- Fixes move from h2 to mysql Affects issues: - #1472 - Fixed #1111
This commit is contained in:
parent
0186f448c9
commit
9af7d689b2
@ -91,16 +91,6 @@ public class ManageMoveCommand extends CommandNode {
|
||||
return;
|
||||
}
|
||||
|
||||
// Temporarily disabled due to issues
|
||||
boolean transferH2 = fromDB == DBType.H2 || toDB == DBType.H2;
|
||||
boolean transferMySQL = fromDB == DBType.MYSQL || toDB == DBType.MYSQL;
|
||||
|
||||
if (transferH2 && transferMySQL) {
|
||||
sender.sendMessage("§cDirect transfers between H2 and MySQL are temporarily disabled due to a bug: See the issue link for workaround");
|
||||
sender.sendLink("Link to Github Issue", "https://github.com/plan-player-analytics/Plan/issues/1111");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
final Database fromDatabase = dbSystem.getActiveDatabaseByType(fromDB);
|
||||
final Database toDatabase = dbSystem.getActiveDatabaseByType(toDB);
|
||||
|
@ -32,6 +32,8 @@ public class DatabaseSettings {
|
||||
public static final Setting<String> MYSQL_HOST = new StringSetting("Database.MySQL.Host");
|
||||
public static final Setting<String> MYSQL_PORT = new StringSetting("Database.MySQL.Port", NumberUtils::isParsable);
|
||||
public static final Setting<String> MYSQL_USER = new StringSetting("Database.MySQL.User");
|
||||
public static final Setting<String> H2_USER = new StringSetting("Database.H2.User");
|
||||
public static final Setting<String> H2_PASS = new StringSetting("Database.H2.Password");
|
||||
public static final Setting<String> MYSQL_PASS = new StringSetting("Database.MySQL.Password");
|
||||
public static final Setting<String> MYSQL_DATABASE = new StringSetting("Database.MySQL.Database");
|
||||
public static final Setting<String> MYSQL_LAUNCH_OPTIONS = new StringSetting("Database.MySQL.Launch_options");
|
||||
|
@ -86,8 +86,8 @@ public class H2DB extends SQLDB {
|
||||
}
|
||||
|
||||
private Connection getConnectionFor(String dbFilePath) throws SQLException {
|
||||
String username = config.get(DatabaseSettings.MYSQL_USER);
|
||||
String password = config.get(DatabaseSettings.MYSQL_PASS);
|
||||
String username = config.get(DatabaseSettings.H2_USER);
|
||||
String password = config.get(DatabaseSettings.H2_PASS);
|
||||
|
||||
JdbcDataSource jdbcDataSource = new JdbcDataSource();
|
||||
jdbcDataSource.setURL("jdbc:h2:file:" + dbFilePath + ";mode=MySQL;DATABASE_TO_UPPER=false");
|
||||
@ -99,6 +99,8 @@ public class H2DB extends SQLDB {
|
||||
|
||||
private void startConnectionPingTask() {
|
||||
stopConnectionPingTask();
|
||||
logger.warn("H2 database is going to be deprecated in version 5.2. It is recommended to move to MySQL or SQLite when possible.");
|
||||
logger.warn("See https://github.com/plan-player-analytics/Plan/issues/1472 for details");
|
||||
try {
|
||||
// Maintains Connection.
|
||||
connectionPingTask = runnableFactory.create("DBConnectionPingTask " + getType().getName(),
|
||||
|
@ -34,6 +34,9 @@ Database:
|
||||
Database: Plan
|
||||
# Launch options to append after mysql driver address
|
||||
Launch_options: ?rewriteBatchedStatements=true&useSSL=false
|
||||
H2:
|
||||
User: root
|
||||
Password: minecraft
|
||||
# -----------------------------------------------------
|
||||
# More information about SSL Certificate Settings:
|
||||
# https://github.com/Rsl1122/Plan-PlayerAnalytics/wiki/SSL-Certificate-%28HTTPS%29-Set-Up
|
||||
|
@ -109,6 +109,8 @@ public class ConfigSettingKeyTest {
|
||||
settings.remove(PluginSettings.PROXY_COPY_CONFIG);
|
||||
settings.remove(DatabaseSettings.TYPE);
|
||||
settings.remove(DisplaySettings.WORLD_ALIASES);
|
||||
settings.remove(DatabaseSettings.H2_USER);
|
||||
settings.remove(DatabaseSettings.H2_PASS);
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user