Clarify the file names of H2 and SQLite databases

This commit is contained in:
Luck 2017-03-18 23:00:12 +00:00
parent bdff84885a
commit 1e134df27d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 14 additions and 2 deletions

View File

@ -124,9 +124,9 @@ public class StorageFactory {
case MYSQL:
return new SQLBacking(plugin, new MySQLProvider(plugin.getConfiguration().get(ConfigKeys.DATABASE_VALUES)), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
case SQLITE:
return new SQLBacking(plugin, new SQLiteProvider(new File(plugin.getDataDirectory(), "luckperms.sqlite")), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
return new SQLBacking(plugin, new SQLiteProvider(new File(plugin.getDataDirectory(), "luckperms-sqlite.db")), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
case H2:
return new SQLBacking(plugin, new H2Provider(new File(plugin.getDataDirectory(), "luckperms.db")), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
return new SQLBacking(plugin, new H2Provider(new File(plugin.getDataDirectory(), "luckperms-h2")), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
case POSTGRESQL:
return new SQLBacking(plugin, new PostgreSQLProvider(plugin.getConfiguration().get(ConfigKeys.DATABASE_VALUES)), plugin.getConfiguration().get(ConfigKeys.SQL_TABLE_PREFIX));
case MONGODB:

View File

@ -27,6 +27,12 @@ import java.io.File;
public class H2Provider extends FlatfileProvider {
public H2Provider(File file) {
super("H2", file);
// backwards compat
File data = new File(file.getParent(), "luckperms.db.mv.db");
if (data.exists()) {
data.renameTo(new File(file.getParent(), "luckperms-h2.mv.db"));
}
}
@Override

View File

@ -27,6 +27,12 @@ import java.io.File;
public class SQLiteProvider extends FlatfileProvider {
public SQLiteProvider(File file) {
super("SQLite", file);
// backwards compat
File data = new File(file.getParent(), "luckperms.sqlite");
if (data.exists()) {
data.renameTo(new File(file.getParent(), "luckperms-sqlite.db"));
}
}
@Override