Add SQLiteToH2 converter
This commit is contained in:
parent
910ebdd5bf
commit
cd5a008637
@ -11,6 +11,7 @@ import fr.xephi.authme.datasource.converter.LoginSecurityConverter;
|
|||||||
import fr.xephi.authme.datasource.converter.MySqlToSqlite;
|
import fr.xephi.authme.datasource.converter.MySqlToSqlite;
|
||||||
import fr.xephi.authme.datasource.converter.RakamakConverter;
|
import fr.xephi.authme.datasource.converter.RakamakConverter;
|
||||||
import fr.xephi.authme.datasource.converter.RoyalAuthConverter;
|
import fr.xephi.authme.datasource.converter.RoyalAuthConverter;
|
||||||
|
import fr.xephi.authme.datasource.converter.SqliteToH2;
|
||||||
import fr.xephi.authme.datasource.converter.SqliteToSql;
|
import fr.xephi.authme.datasource.converter.SqliteToSql;
|
||||||
import fr.xephi.authme.datasource.converter.VAuthConverter;
|
import fr.xephi.authme.datasource.converter.VAuthConverter;
|
||||||
import fr.xephi.authme.datasource.converter.XAuthConverter;
|
import fr.xephi.authme.datasource.converter.XAuthConverter;
|
||||||
@ -89,6 +90,7 @@ public class ConverterCommand implements ExecutableCommand {
|
|||||||
.put("vauth", VAuthConverter.class)
|
.put("vauth", VAuthConverter.class)
|
||||||
.put("sqlitetosql", SqliteToSql.class)
|
.put("sqlitetosql", SqliteToSql.class)
|
||||||
.put("mysqltosqlite", MySqlToSqlite.class)
|
.put("mysqltosqlite", MySqlToSqlite.class)
|
||||||
|
.put("sqlitetoh2", SqliteToH2.class)
|
||||||
.put("loginsecurity", LoginSecurityConverter.class)
|
.put("loginsecurity", LoginSecurityConverter.class)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
package fr.xephi.authme.datasource.converter;
|
||||||
|
|
||||||
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
|
import fr.xephi.authme.datasource.DataSourceType;
|
||||||
|
import fr.xephi.authme.datasource.SQLite;
|
||||||
|
import fr.xephi.authme.initialization.DataFolder;
|
||||||
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import java.io.File;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts SQLite to H2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class SqliteToH2 extends AbstractDataSourceConverter<SQLite>{
|
||||||
|
|
||||||
|
private final Settings settings;
|
||||||
|
private final File dataFolder;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
SqliteToH2(Settings settings, DataSource dataSource, @DataFolder File dataFolder) {
|
||||||
|
super(dataSource, DataSourceType.H2);
|
||||||
|
this.settings = settings;
|
||||||
|
this.dataFolder = dataFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SQLite getSource() throws SQLException {
|
||||||
|
return new SQLite(settings, dataFolder);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user