- Detect if a migration is necessary - Create a backup - Perform the migration
This commit is contained in:
@@ -3,9 +3,11 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -14,15 +16,17 @@ import java.sql.SQLException;
|
||||
public class SqliteToSql extends AbstractDataSourceConverter<SQLite> {
|
||||
|
||||
private final Settings settings;
|
||||
private final File dataFolder;
|
||||
|
||||
@Inject
|
||||
SqliteToSql(Settings settings, DataSource dataSource) {
|
||||
SqliteToSql(Settings settings, DataSource dataSource, @DataFolder File dataFolder) {
|
||||
super(dataSource, DataSourceType.MYSQL);
|
||||
this.settings = settings;
|
||||
this.dataFolder = dataFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SQLite getSource() throws SQLException, ClassNotFoundException {
|
||||
return new SQLite(settings);
|
||||
protected SQLite getSource() throws SQLException {
|
||||
return new SQLite(settings, dataFolder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user