Update MySQL driver class name
+ implement fallback to the legacy driver
This commit is contained in:
@@ -60,10 +60,15 @@ public class SettingsMigrationService extends PlainMigrationService {
|
||||
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
|
||||
protected boolean performMigrations(PropertyReader reader, ConfigurationData configurationData) {
|
||||
boolean changes = false;
|
||||
|
||||
if ("[a-zA-Z0-9_?]*".equals(reader.getString(ALLOWED_NICKNAME_CHARACTERS.getPath()))) {
|
||||
configurationData.setValue(ALLOWED_NICKNAME_CHARACTERS, "[a-zA-Z0-9_]*");
|
||||
changes = true;
|
||||
}
|
||||
if ("com.mysql.jdbc.Driver".equals(reader.getString(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getPath()))) {
|
||||
configurationData.setValue(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME, "com.mysql.cj.jdbc.Driver");
|
||||
changes = true;
|
||||
}
|
||||
|
||||
setOldOtherAccountsCommandFieldsIfSet(reader);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class DatabaseSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Driver Name of the MySQL database")
|
||||
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
||||
newProperty("DataSource.mySQLDriverClassName", "com.mysql.jdbc.Driver");
|
||||
newProperty("DataSource.mySQLDriverClassName", "com.mysql.cj.jdbc.Driver");
|
||||
|
||||
@Comment("Database Name, use with converters or as SQLITE database name")
|
||||
public static final Property<String> MYSQL_DATABASE =
|
||||
|
||||
Reference in New Issue
Block a user